Regqueryvalueex
This function is used to find a registry key for a given type and value. To ensure that any string is returned with a null Terminator, use the reggetvalue function.
Long regqueryvalueex (
Hkey,
Lpctstr lpvaluename,
Lpdword lpreserved,
Lpdword lptype,
Lpbyte lpdata,
Lpdword lpcbdata
);
Parameters
Hkey
The input parameter points to a handle that opens the key. This key must be enabled at the security level of key_query_value. This parameter can be the return value of regcreatekeyex or regopenkeyex. It can also be the following predefined values
Hkey_classes_root
Hkey_current_config
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
Hkey_performance_data
Hkey_performance_nlstext
Hkey_cece_text
HKEY_USERS
Lpvaluename
The input parameter points to a string ending with null, which stores the key name to be queried. If this parameter is null or points to an empty string, the function obtains the type and value of the Untitled key or default key.
Lpreserved
Save, must be null
Lptype
The output parameter indicates the type of the queried key. If the search fails, the return value is null.
Lpdata
Output parameter, which indicates the key value found. If the search fails, null is returned.
Lpcbdata
The output parameter is an input parameter. The length of the key value in bytes, including the Terminator.
Return values
If the function is successful, error_success is returned;