|
-
Jan 15th, 2000, 12:58 PM
#1
Thread Starter
Lively Member
Hi,
I got this code from Aaron Young, and it works great. But ...
Can some tell me how to read a value from the registry in HKEY_LOCAL_MACHINE.
R@emdonck
Code:
Private Declare Function RegCreateKey Lib "advapi32.dll" Alias "RegCreateKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As LongPrivate Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As LongPrivate 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
Private Const HKEY_LOCAL_MACHINE = &H80000002
Private Sub Command1_Click()
Dim lRegKey As Long
If RegCreateKey(HKEY_LOCAL_MACHINE, "Software\Main Folder\Sub Folder", lRegKey) = 0 Then Call RegSetValue(lRegKey, "", 1, "Value", Len("Value"))
End If
If lRegKey Then Call RegCloseKey(lRegKey)
End Sub
[This message has been edited by R@emdonck (edited 01-16-2000).]
-
Jan 16th, 2000, 04:04 PM
#2
Thread Starter
Lively Member
HELP, HELP, HELP, HELP, HELP, HELP, ...
-
Jan 16th, 2000, 05:05 PM
#3
-
Jan 16th, 2000, 06:33 PM
#4
Lively Member
R@emdonck.
Download the file named regobj.exe from the URL,http://www.freedrive.com/ASP/PostFolderShortcut.asp?fsc=2940490.
This is a self-extracting file so just run it and read the instructions on screen.
Hope it will help you.
------------------
-----------------------
Maartin
[email protected]
-----------------------
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
|