Enumerates subkeys of the specified open registry key. This function retrieves information about one subkey each time it is called, enumerating the subkey's class name and the time it was last modified.
LONG RegEnumKeyEx(
HKEY hKey,
DWORD dwIndex,
LPTSTR lpName,
LPDWORD lpcName,
LPDWORD lpReserved,
LPTSTR lpClass,
LPDWORD lpcClass,
PFILETIME lpftLastWriteTime );
hKey
HKEY_CLASSES_ROOT HKEY_CURRENT_CONFIG HKEY_CURRENT_USER HKEY_LOCAL_MACHINE HKEY_USERS HKEY_PERFORMANCE_DATA
The enumerated keys are subkeys of the key identified by hKey.
dwIndex
RegEnumKeyEx
and then incremented for subsequent calls. Because subkeys are not ordered, any new subkey has an arbitrary index. This means the call may return subkeys in any order.
lpName
lpcName
lpName
parameter. This size should include the terminating null character. When the call returns, the variable pointed to by lpcName
contains the number of characters stored in the buffer. The count returned does not include the terminating null character.
lpReserved
lpClass
lpcClass
lpClass
parameter. The size should include the terminating null character. When the call returns, lpcClass
contains the number of characters stored in the buffer. The count returned does not include the terminating null character. If lpClass
is NULL, this parameter can be NULL.
lpftLastWriteTime
To enumerate subkeys, an application should initially make this call with the dwIndex parameter set to zero. The application should then increment the dwIndex parameter and make this call until no more subkeys exist (until the call returns ERROR_NO_MORE_ITEMS).
The application can also set dwIndex to the index of the last subkey on the first call to the call and decrement the index until the subkey with the index 0 is enumerated. To retrieve the index of the last subkey, use RegQueryInfoKey.
While an application uses this call, it should not make calls to any registration call that might change the key being enumerated.
The key identified by hKey must be opened with KEY_ENUMERATE_SUB_KEYS access (KEY_READ incudes KEY_ENUMERATE_SUB_KEYS). Use RegCreateKeyEx or RegOpenKeyEx to open the key.
ERROR_SUCCESS
Versions | Defined in | Include | Link to |
---|---|---|---|
INtime 3.0 | intime/rt/include/iwin32.h | iwin32.h iwin32rt.h |
rt.lib |
Note
This function operates in the real-time portion of your application.
RegCreateKeyEx, RegDeleteKey, RegOpenKeyEx, RegQueryInfoKey, iwin32 API, iwin32 Overview