Results 1 to 4 of 4

Thread: HKEY_LOCAL_MACHINE (part 2)

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Location
    Belgium
    Posts
    98

    Post

    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).]

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Nov 1999
    Location
    Belgium
    Posts
    98

    Post

    HELP, HELP, HELP, HELP, HELP, HELP, ...

  3. #3
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Post

    Read Johns article about it.

    ------------------
    Joacim Andersson
    [email protected]
    [email protected]
    www.YellowBlazer.com



  4. #4
    Lively Member Maartin's Avatar
    Join Date
    Jan 2000
    Location
    Benoni, Gauteng, South-Africa
    Posts
    99

    Post

    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
  •  



Click Here to Expand Forum to Full Width