INtime SDK Help
RegEnumKeyEx (iwin32)
INtime SDK v7.1 > About INtime > Alternate APIs > iwin32 API > iwin32 API > RegEnumKeyEx (iwin32)

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 );

Parameters

hKey
Handle to a currently open key or one of the following predefined reserved handle values:

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
Specifies the index of the subkey to retrieve. This parameter should be zero for the first call to 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
Pointer to a buffer that receives the subkey's name, including the terminating null character. The call copies only the subkey's name, not the full key hierarchy, to the buffer.
lpcName
Pointer to a variable that specifies the number of characters of the buffer specified by the 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
Reserved; must be NULL.
lpClass
Pointer to a buffer that contains the class of the enumerated subkey when the call returns. If the class is not required, this parameter can be NULL.
lpcClass
Pointer to a variable that specifies the number of characters of the buffer specified by the 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
Pointer to a variable that receives the time the enumerated subkey was last written to.

Remarks

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.

Return Values

ERROR_SUCCESS
Success.
A nonzero status code defined in RTWIN32.H.
Failure. For extended error information, see GetLastError.

Requirements

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.

See Also

RegCreateKeyEx, RegDeleteKey, RegOpenKeyEx, RegQueryInfoKey, iwin32 API, iwin32 Overview