|
-
May 17th, 2008, 11:40 AM
#1
Thread Starter
Addicted Member
Problem writing to registry
Hi,
I'm trying to write to the registry in vista while trying to adhere to the User Access Control guidelines. I can write to the registry, but the data written ends up as random letters. take a look at the code i'm using:
[vbcode]
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 RegCloseKey Lib "advapi32.dll" (ByVal Hkey 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 String, ByVal cbData As Long) As Long
Dim RegKey as Long
RegCreateKey &H80000001, "Software\Microsoft\Windows\CurrentVersion\Run\", RegKey
RegSetValueEx RegKey, "testing", 0, 1, "temp", 4
RegCloseKey (RegKey)
[/vbcode]
When I go to check the registry, the key name "testing" is fine, but the value of it "temp" ends up looking like "L.". Any ideas?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|