Enumerates subkeys of the specified open registry key. The call retrieves information about one subkey each time it is called. This call enumerates the class name of the subkey and the time it was last modified.
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 there are no more subkeys (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 RtRegQueryInfoKey.
While an application is using this call, it should not make calls to any registration calls that might change the key being enumerated.
The key identified by hKey must have been opened with KEY_ENUMERATE_SUB_KEYS access (KEY_READ includes KEY_ENUMERATE_SUB_KEYS). Use RtRegCreateKeyEx or RtRegOpenKeyEx to open the key.
LONG RtRegEnumKeyEx(
    HKEY hKey,                   // handle to key to enumerate
    DWORD dwIndex,               // index of subkey to enumerate
    LPTSTR lpName,               // address of buffer for subkey name
    LPDWORD lpcbName,            // address for size of subkey buffer
    LPDWORD lpReserved,          // reserved
    LPTSTR lpClass,              // address of buffer for class string
    LPDWORD lpcbClass,           // address for size of class buffer
    PFILETIME lpftLastWriteTime  // address for time key last written to
);
hKey 
dwIndex 
RtRegEnumKeyEx and then incremented for subsequent calls. Because subkeys are not ordered, any new subkey has an arbitrary index. This means that the call may return subkeys in any order. 
lpName 
lpcbName 
lpName parameter. This size should include the terminating null character. When the call returns, the variable pointed to by lpcbName contains the number of characters stored in the buffer. The count returned does not include the terminating null character. 
lpReserved 
lpClass 
lpcbClass 
lpClass parameter. The size should include the terminating null character. When the call returns, lpcbClass contains the number of characters stored in the buffer. The count returned does not include the terminating null character. This parameter can be NULL only if lpClass is NULL. 
lpftLastWriteTime 
ERROR_SUCCESS 
| Versions | Defined in | Include | Link to | 
|---|---|---|---|
| INtime 3.0 | intime/rt/include/rtbase.h | rt.h | rt.lib | 
Registry system calls, RtRegQueryInfoKey, RtRegCreateKeyEx, RtRegOpenKeyEx, RtRegDeleteKey