Function Reference


Retrieves information about the specified registry key

#include <WinAPIReg.au3>
_WinAPI_RegQueryInfoKey ( $hKey )


$hKey Handle to an open registry key. The key must have been opened with the $KEY_QUERY_VALUE access right.
This handle is returned by the _WinAPI_RegCreateKey() or _WinAPI_RegOpenKey() function. It can also
be one of the following predefined keys.

Return Value

Success: The array containing the following information:
[0] - The number of subkeys that are contained by the specified key.
[1] - The size of the key's subkey with the longest name, in characters, not including the terminating null character.
[2] - The number of values that are associated with the key.
[3] - The size of the key's longest value name, in characters. The size does not include the terminating null character.
[4] - The size of the longest data component among the key's values, in bytes.
Failure: Sets the @error flag to non-zero, @extended flag may contain the system error code.


_WinAPI_RegCreateKey, _WinAPI_RegOpenKey

See Also

Search RegQueryInfoKey in MSDN Library.


#include <APIRegConstants.au3>
#include <Array.au3>
#include <MsgBoxConstants.au3>
#include <WinAPIError.au3>
#include <WinAPIReg.au3>

Local $hKey = _WinAPI_RegOpenKey($HKEY_CLASSES_ROOT, 'CLSID', $KEY_READ)
If @error Then
    MsgBox(BitOR($MB_ICONERROR, $MB_SYSTEMMODAL), @extended, _WinAPI_GetErrorMessage(@extended))
Local $iCount = _WinAPI_RegQueryInfoKey($hKey)
Local $aKey[$iCount[0]]
For $i = 0 To UBound($aKey) - 1
    $aKey[$i] = _WinAPI_RegEnumKey($hKey, $i)


_ArrayDisplay($aKey, '_WinAPI_RegEnumKey')