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"