WinXRegistry_ReadInt


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

Reads an integer value 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 an integer from the registry
result = 0
WinXRegistry_ReadInt ($$HKEY_LOCAL_MACHINE, "SOFTWARE\\myapp", "anInt", $$TRUE, WinXNewACL($$ACL_REG_STANDARD, $$TRUE), @result)
PRINT "Result is: ";result

Related Links

WinXNewACL
WinXRegistry_ReadString
WinXRegistry_ReadBin
WinXRegistry_WriteInt