بسم الله
انا بحاول مع الكود اللي في المرفقات ومش عارف ماله
وهو كود خاص باضافة قيمة في الريجستري
مع اني جيبت واحد شبيهه بالظبط واشتغل
لو سمحتم حد يقولي ايه الغلط
وجزاكم الله خيرا
'//************************************************
'// Neo-Guide ALLVB FUCTIONS
'// Chap 11 : Less 09 =Reg --->RegCreateKey
'//*************************************************
Const REG_SZ = 1 ' Unicode nul terminated string
Const REG_BINARY = 3 ' Free form binary
Const HKEY_CURRENT_USER = &H80000001
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
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
Private Sub Command1_Click()
Dim Ret As Long
Dim hkey As Long
Dim strPath As String
Dim strValue As String
Dim strData As String
'Create a new key
hkey = &H80000001
strPath = "Software\Microsoft\Windows\Currentversion\Run\Amir"
strValue = "yayayaa"
RegCreateKey hkey, strPath, Ret
'Save a string to the key
RegSetValueEx Ret, strValue, 0, REG_SZ, ByVal strData, Len(strData)
'close the key
RegCloseKey Ret
End Sub
بالتوفيق
هذا الموضوع مغلق.