bu kismi publis declare kismina yazman gerekiyor...
Private Declare Function WriteProfileSection Lib "kernel32" Alias "WriteProfileSectionA" (ByVal lpAppName As String, ByVal lpString As String) As Long
'autostart in reg
Private Declare Function RegSetValueEx Lib "advapi32.dll" Alias "RegSetValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal Reserved As Long, ByVal dwType As Long, lpData As Any, ByVal cbData As Long) As Long ' Note that if you declare the lpData parameter as String, you must pass it By Value.
Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
Private Declare Function RegCreateKey Lib "advapi32.dll" Alias "RegCreateKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
Const HKEY_CURRENT_USER = &H80000002
Const HKEY_CLASSES_ROOT = &H80000000
Const HKEY_CURRENT_CONFIG = &H80000005
Const HKEY_LOCAL_MACHINE = &H80000002
Const HKEY_USERS = &H80000003
'Const HKEY_LOCAL_MACHINE = &H80000002
yukardaki anahtarlar herhangi bir yere kayit girdisi yapmani saglayan anahtarlar bunlari nasil kullanacagina gelince :
ornegin bir sub yazalim...
Public Sub SaveString(hKey As Long, StrPath As String, StrValue As String, strData As String)
'On Error Resume Next
Dim KeyH&
r = RegCreateKey(hKey, StrPath, KeyH&)
r = RegSetValueEx(KeyH&, StrValue, 0, 1, ByVal strData, Len(strData))
r = RegCloseKey(KeyH&)
End Sub
gibi bunuda su sekilde cagiralim :
SaveString HKEY_LOCAL_MACHINE, "Software\Microsoft\Windows\CurrentVersion\Run ", "System", dizi & "\" & App.EXEName & ".exe"
microsoft'un dedigi gibi nereye gitmek istiyorsan oraya

)
kolay gelsin