api问题,actpvb可否回答?

happy_gambler 2001-10-25 11:09:03
Private Declare Function regcreatekey& Lib "advapi32.dll" Alias "regcreatekey a" (ByVal hkey&, ByVal ipszsbukey&, iphkey&)
Private Declare Function regsetvalue Lib "advapi32.dll" Alias "regsetvaluea" (ByVal hkey As Long, ByVal ipsbukey As String, ByVal ipsubkey As String, ByVal dwtype As Long, ByVal ipdata As String, ByVal cbdata As Long) As Long
Const hkey_local_machine = &H80000002
Const reg_sg = 1



Private Sub Command1_Click()
Dim skeyname As String, skeyvalue As String, skeyvalueicon As String
Dim ret As Integer, iphkey As Long
skeyname = "software\microsoft\windows\currentversion\run"
skeyvalue = App.Path & IIf(Len(App.Path) > 3, "\" & "form1.exe", "form1.exe")
ret = regcreatekey&(hkey_local_machine, skeyname, iphkey)
ret = regsetvalue&(lphkey&, "", reg_sz, skyvalue, 0&)
End Sub

为什么参数不可选哪?
...全文
59 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
yangzhaoyu 2001-10-25
  • 打赏
  • 举报
回复
你的API定义正确吗
Public Declare Function RegSetValue Lib "advapi32.dll" Alias "RegSetValueA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal dwType As Long, ByVal lpData As String, ByVal cbData As Long) As Long

1,485

社区成员

发帖
与我相关
我的任务
社区描述
VB API
社区管理员
  • API
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧