RegQueryInfoKey

  LONG RegQueryInfoKey(hkey, lpszClass, lpcbClass, lpdwReserved, lpcSubKeys, lpcbMaxSubkey, lpcbMaxClass, lpcValues, lpcbMaxValueName, lpcbMaxValueData, lpcbSecurityDescriptor, lpftLastWriteTime)    
  HKEY hkey; /* identifies key to query */
  LPTSTR lpszClass; /* buffer for class string */
  LPDWORD lpcbClass; /* size of class string buffer */
  LPDWORD lpdwReserved; /* reserved; should be NULL */
  LPDWORD lpcSubKeys; /* buffer for number of subkeys */
  LPDWORD lpcbMaxSubkey; /* buffer for longest subkey size */
  LPDWORD lpcbMaxClass; /* buffer for longest class string length */
  LPDWORD lpcValues; /* buffer for number of value IDs */
  LPDWORD lpcbMaxValueName; /* buffer for longest value name length */
  LPDWORD lpcbMaxValueData; /* buffer for longest value data length */
  LPDWORD lpcbSecurityDescriptor; /* buffer for descriptor length */
  PFILETIME lpftLastWriteTime; /* buffer for last write time */

The RegQueryInfoKey function retrieves information about a specified configuration registry key.

Parameters

hkey

Specifies an open configuration registry key to return information for, or one of the following predefined handles:

HKEY_CLASSES_ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE HKEY_USERS

lpszClass

Points to a buffer that receives the key's class string.

lpcbClass

Points to a variable that specifies the size of the buffer at lpszClass (in bytes). When the function returns, this variable contains the length of the class string stored in the buffer.

lpdwReserved

Reserved; should be NULL.

lpcSubKeys

Points to a variable that receives the number of subkeys the key has.

lpcbMaxSubkey

Points to a variable that receives the size of the key's longest subkey (in bytes).

lpcbMaxClass

Points to a variable that receives the length of the longest subkey class string (in bytes).

lpcValues

Points to a variable that receives the number of values the key has.

lpcbMaxValueName

Points to a variable that receives the size of the key's longest value name (in bytes).

lpcbMaxValueData

Points to a variable that receives the size of the key's longest value entry data field (in bytes).

lpcbSecurityDescriptor

Points to a variable that receives the length of this key's SECURITY_DESCRIPTOR.

lpftLastWriteTime

Points to a variable that receives a FILETIME structure indicating the last time the key or any of its value entries was modified.

Return Value

The return value is ERROR_SUCCESS if the function is successful. Otherwise, it is an error value.

Comments

The RegQueryInfoKey function may be used as either a wide-character function (where text arguments must use Unicode) or an ANSI function (where text arguments must use characters from the Windows 3.x character set installed).

See Also

RegQueryValue, RegQueryValueEx, RegEnumKey, RegEnumKeyEx, RegEnumValue