RegOpenKey返回值不是0,为什么急急急
这是我的代码:
Public Declare Function RegOpenKey Lib "advapi32.dll " Alias "RegOpenKeyA " (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Public Declare Function RegCreateKey Lib "advapi32.dll " _
Alias "RegCreateKeyA " (ByVal hKey As Long, _
ByVal lpSubKey As String, _
phkResult As Long) As Long
Public Const HKEY_LOCAL_MACHINE = &H80000002
public sub result()
Dim result As Long
Dim hKeyID As Long
result = RegOpenKey(HKEY_LOCAL_MACHINE, _
"SOFTWARE/Microsoft/Windows/CurrentVersion/Run ", hKeyID)
end sub
在返回值result =2,为什么啊?
我把写成:result = RegCreateKey(HKEY_LOCAL_MACHINE, _
"SOFTWARE/Microsoft/Windows/CurrentVersion/Run ", hKeyID)
返回值result =87,为什么我得不到正确的值0,哪位大哥给我回答一下,感激不尽
[解决办法]
注册表路径不用 "/ "
[解决办法]
呵呵,真没注意,LZ用的是“/”,狂晕不止!