Skip to content

Latest commit

 

History

History
70 lines (49 loc) · 1.81 KB

File metadata and controls

70 lines (49 loc) · 1.81 KB

Home

Function name : RegQueryValueEx

Group: Registry - Library: advapi32


Retrieves the type and data for a specified value name associated with an open registry key.


Code examples:

Obtaining current Internet Explorer browser version and UserAgent
Enumerating Performance Counters

Declaration:

LONG RegQueryValueEx(
  HKEY hKey,            // handle to key
  LPCTSTR lpValueName,  // value name
  LPDWORD lpReserved,   // reserved
  LPDWORD lpType,       // type buffer
  LPBYTE lpData,        // data buffer
  LPDWORD lpcbData      // size of data buffer
);  

FoxPro declaration:

DECLARE INTEGER RegQueryValueEx IN advapi32;
	INTEGER   hKey,;
	STRING    lpValueName,;
	INTEGER   lpReserved,;
	INTEGER @ lpType,;
	STRING  @ lpData,;
	INTEGER @ lpcbData
  

Parameters:

hKey [in] Handle to a currently open key or a predefined reserved handle value.

lpValueName [in] Pointer to a null-terminated string containing the name of the value to query.

lpReserved Reserved; must be NULL.

lpType [out] Pointer to a variable that receives a code indicating the type of data stored in the specified value.

lpData [in, out] Pointer to a buffer that receives the value"s data.

lpcbData [in/out] Pointer to a variable that specifies the size, in bytes, of the buffer pointed to by the lpData parameter. When the function returns, this variable contains the size of the data copied to lpData.


Return value:

If the function succeeds, the return value is 0 (ERROR_SUCCESS). If the function fails, the return value is a nonzero error code.