Private Sub Command1_Click()
rel = RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE", hKey)
Print rel
End Sub
模块:
Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
为什么返回值都是6
VB的RegOpenKey函数的问题
答案:1 悬赏:20 手机版
解决时间 2021-03-23 08:49
- 提问者网友:凉末
- 2021-03-22 13:13
最佳答案
- 五星知识达人网友:往事隔山水
- 2021-03-22 13:44
HKEY_LOCAL_MACHINE需要赋值常数:
Private Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Private Sub Command1_Click()
HKEY_LOCAL_MACHINE = &H80000002
rel = RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE", hKey)
Print rel
End Sub
Private Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Private Sub Command1_Click()
HKEY_LOCAL_MACHINE = &H80000002
rel = RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE", hKey)
Print rel
End Sub
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯