Previous Topic: RegOpenKey - Open a KeyNext Topic: RegQueryVariable - Retrieve the Type and Value of a Variable


RegQueryValue - Retrieve a Text String

Valid on Windows

The RegQueryValue function retrieves the text string associated with the specified registry key\subkey, if the unnamed default value (data) of the opened key is to be fetched.

This registry manipulation function has the format:

RegQueryValue(hKey as Integer, subkey as String, value as String) as Boolean
hKey

Identifies a currently open key or a predefined key. The hKey parameter can have one of the following predefined values:

HKEY_CLASSES_ROOT
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_USERS
subkey

Identifies, together with the key, the default value that is to be retrieved. The subkey can be any subkey or the empty string, if the unnamed value of the opened key is to be fetched. The subkey must be a subkey of the key identified by the hKey parameter. The parameter value is a string variable that receives the value of the subkey.

Value

Holds the returned value (data) of the specified key\subkey.

On successful completion, the function returns TRUE and fills the string associated with the specified key\subkey into the value variable; otherwise, it returns FALSE.