错误创建注册表键:HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run RegCreateKeyEx
错误创建注册表键:HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\RunRegCreateKeyE...
错误创建注册表键:HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run RegCreateKeyEx 失败;代码5 这个怎么处理啊
展开
展开全部
声明RegCreateKeyEx时第七个参数要改一改
Private Declare Function RegCreateKeyEx Lib "advapi32.dll" Alias "RegCreateKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal Reserved As Long, ByVal lpClass As String, ByVal dwOptions As Long, ByVal samDesired As Long, ByVal lpSecurityAttributes As Long, phkResult As Long, lpdwDisposition As Long) As Long
调用时这样做
Dim hhKey as Long
RegCreateKeyEx HKEY_CURRENT_USER,"Software\Microsoft\Windows\CurrentVersion\Run",0,vbNullString,0,KEY_ALL_ACCESS,0,hhKey,ByVal 0
Private Declare Function RegCreateKeyEx Lib "advapi32.dll" Alias "RegCreateKeyExA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal Reserved As Long, ByVal lpClass As String, ByVal dwOptions As Long, ByVal samDesired As Long, ByVal lpSecurityAttributes As Long, phkResult As Long, lpdwDisposition As Long) As Long
调用时这样做
Dim hhKey as Long
RegCreateKeyEx HKEY_CURRENT_USER,"Software\Microsoft\Windows\CurrentVersion\Run",0,vbNullString,0,KEY_ALL_ACCESS,0,hhKey,ByVal 0
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询