Results 1 to 2 of 2

Thread: Registry question

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2001
    Location
    ae
    Posts
    9

    Registry question

    i'm trying to store value in a binary key on the left portion where hex values are written.

    I'm able to store values in the binary key through REG_BINARY but it stores the value on the right portion where ASCII values are written.

    I tried REG_SZ but that changed the key to string value.

    How can I store the value on the left portion in binary key?

  2. #2
    Sc0rp
    Guest
    In order to set a binary value, pass the RegSetValueEx API the bytes that represent the string you want to store. Example:
    Code:
    Dim hKey As Long
    Dim arrString(2) As Byte
      
    arrString(0) = 65
    arrString(1) = 68
    arrString(2) = 69
        
    RegOpenKeyEx hKeyEY_LOCAL_MACHINE, "", ByVal 0&, ByVal 0&, hKey
    RegSetValueEx hKey, "Blah", 0, REG_BINARY, arrString(0), Len(arrString(0)) * (UBound(arrString) + 1)
    RegCloseKey hKey
    That will create a new value under HKEY_LOCAL MACHINE, named "Blah". TIt will hold the string "ADE"

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