api问题,actpvb可否回答?
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
为什么参数不可选哪?