找找windows关于系统编程的sdk,不过这样做
好象很不友好欧!!

解决方案 »

  1.   

    1.在新建的from中增加一个button
     2.增加一个模块,放入以下代码
    Declare Function RegCreateKey& Lib "advapi32.DLL" Alias "RegCreateKeyA" (ByVal hKey&, ByVal lpszSubKey$, lphKey&)Declare Function RegSetValue& Lib "advapi32.DLL" Alias "RegSetValueA" (ByVal hKey&, ByVal lpszSubKey$, ByVal fdwType&, ByVal lpszValue$, ByVal dwLength&)
           Public Const ERROR_SUCCESS = 0&
           Public Const ERROR_BADDB = 1&
           Public Const ERROR_BADKEY = 2&
           Public Const ERROR_CANTOPEN = 3&
           Public Const ERROR_CANTREAD = 4&
           Public Const ERROR_CANTWRITE = 5&
           Public Const ERROR_OUTOFMEMORY = 6&
           Public Const ERROR_INVALID_PARAMETER = 7&
           Public Const ERROR_ACCESS_DENIED = 8&
           Global Const HKEY_CLASSES_ROOT = &H80000000
           Public Const MAX_PATH = 256&
           Public Const REG_SZ = 13.在from中放入以下代码
    Private Const ERROR_SUCCESS = 0&
    Private Const ERROR_BADDB = 1&
    Private Const ERROR_BADKEY = 2&
    Private Const ERROR_CANTOPEN = 3&
    Private Const ERROR_CANTREAD = 4&
    Private Const ERROR_CANTWRITE = 5&
    Private Const ERROR_OUTOFMEMORY = 6&
    Private Const ERROR_INVALID_PARAMETER = 7&
    Private Const ERROR_ACCESS_DENIED = 8&
    Private Const HKEY_CLASSES_ROOT = &H80000000
    Private Const MAX_PATH = 256&
    Private Const REG_SZ = 1Private Sub Command1_Click()       Dim sKeyName As String 'Holds Key Name in registry.
           Dim sKeyValue As String 'Holds Key Value in registry.
           Dim ret& 'Holds error status if any from API calls.
           Dim lphKey& 'Holds created key handle from RegCreateKey.
           '     'This creates a Root entry called "MyApp".
           sKeyName = "MyApp" '*
           sKeyValue = "My Application" '*
           ret& = RegCreateKey&(HKEY_CLASSES_ROOT, sKeyName, lphKey&)
           ret& = RegSetValue&(lphKey&, "", REG_SZ, sKeyValue, 0&)
           '     'This creates a Root entry called .BAR associated with "MyApp".
           sKeyName = ".bar" '*
           sKeyValue = "MyApp" '*
           ret& = RegCreateKey&(HKEY_CLASSES_ROOT, sKeyName, lphKey&)
           ret& = RegSetValue&(lphKey&, "", REG_SZ, sKeyValue, 0&)
           '     'This sets the command line for "MyApp".
           sKeyName = "MyApp" '*
           sKeyValue = "notepad.exe %1" '*
           ret& = RegCreateKey&(HKEY_CLASSES_ROOT, sKeyName, lphKey&)
           ret& = RegSetValue&(lphKey&, "shell\open\command", REG_SZ, sKeyValue, MAX_PATH)
    End Sub
    该程序演示如何关连.bar文件到nopad.exe
      

  2.   

    http://expert.csdn.net/Expert/topic/524/524025.xml?temp=.64555