楼上说的我全都声明过的,不行的
Private Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, lpData As Any, ByVal cbData As Long) As Long
Private Declare Function RegCreateKey Lib "advapi32.dll" Alias "RegCreateKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
Private Declare Function RegOpenKeyExA Lib "advapi32.dll" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal ulOptions As Long, ByVal samDesired As Long, phkResult As Long) As Long
Private Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Private Declare Function RegDeleteValue Lib "advapi32.dll" Alias "RegDeleteValueA" (ByVal hKey As Long, ByVal lpValueName As String) As Long
Private Const HKEY_CLASSES_ROOT = &H80000000
Private Const HKEY_CURRENT_USER = &H80000001
Private Const HKEY_LOCAL_MACHINE = &H80000002
Private Const HKEY_USERS = &H80000003
Private Const REG_SZ = 1&
Private Const REG_EXPAND_SZ = 2&
Private Const REG_BINARY = 3&
Private Const REG_DWORD = 4&
Private Const ERROR_SUCCESS = 0&
Private Sub Command1_Click()
Dim hKey As Long
Dim a As Long
a = "91000000"
RegCreateKey_
HKEY_CURRENT_USER, "Software\Microsoft\Windows\CurrentVersion\Policies\Explorer",hKey
RegSetValueEx hKey, "NoDriveTypeAutoRun", 0&, REG_BINARY, a, 3
RegCloseKey hKey
End Sub
以上就是我编的全码,不行的,请高手指点下,网上找不到
另说下二楼的那位朋友如要用 shell调用 我就不会在此求助了,不用你说我都会,要的是VB写的独立程序
[[it] 本帖最后由 dao1975 于 2008-9-1 15:50 编辑 [/it]]