WinXRegistry_ReadBin


WinXRegistry_ReadBin (hKey, subKey$, value$, createOnOpenFail, SECURITY_ATTRIBUTES sa, @result$)

Reads binary data from the registry

Parameter Description
hKey The handle to the key to read from. See remarks for more on this parameter
subKey$ The subkey to read from, remember to double up the backslashes
value$ The value to read from
createOnOpenFail $$TRUE to create the key if it doesn't exist
SECURITY_ATTRIBUTES sa The security attributes for the key if it needs to be created. You can create this with the WinXNewACL function and $$ACL_REG_STANDARD as the parameter
@result The default data for the value. When the function returns this will contain the data from the value

Returns

$$TRUE on success or $$FALSE on fail

Remarks

The hKey parameter can the the handle of an open key, or, more likely, one of these open keys: $$HKEY_CLASSES_ROOT, $$HKEY_CURRENT_USER, $$HKEY_LOCAL_MACHINE, $$HKEY_USERS.

Examples

' Read binary data from the registry
result$ = ""
WinXRegistry_ReadBin ($$HKEY_LOCAL_MACHINE, "SOFTWARE\\myapp", "binaryData", $$TRUE, WinXNewACL($$ACL_REG_STANDARD, $$TRUE), @result$)
PRINT "First dword is: ";HEXX$(XLONGAT(&result$))

Related Links

WinXNewACL
WinXRegistry_ReadInt
WinXRegistry_ReadString
WinXRegistry_WriteBin