SECRegistry::EnumerateKeys

Enumerates subkeys of the currently open key.

Defined in: SECREG.CPP

Syntax

(32-bit) EnumerateKeys(const DWORD dwSubkeyIndex, CString& strSubkeyName);

(32-bit) EnumerateKeys(const DWORD dwSubkeyIndex, CString& strSubkeyName, CString& strClassName );

(32-bit) EnumerateKeys(const DWORD dwSubkeyIndex, LPTSTR lpszSubkeyName, LPDWORD lpdwSizeSubkeyName, LPTSTR lpszClassName, LPDWORD lpdwSizeClassName);

(16-bit) EnumerateKeys( const DWORD dwIndex, LPTSTR lpszBuffer, DWORD dwBufferSize);

Return Value

Nonzero if subkey was enumerated, otherwise 0.

Parameters

dwSubkeyIndex

Index of desired subkey

strSubkeyName

String to receive the enumerated key name.

strClassName

String to receive the enumerated class name.

lpszSubkeyName

Buffer to receive the enumerated key name

lpdwSizeSubkeyName

The size of the lpszSubkeyName buffer in bytes

lpszClassName

Buffer to receive the enumerated class name

lpdwSizeClassName

The size of the lpdwSizeClassName buffer in bytes.

Comments

The 32-bit version encapsulates RegEnumerateKeys API, the 16-bit version encapsulates RegEnumKey.

Example

UINT nIndex = 0;
CString strKeyName;
while (EnumerateKeys(nIndex++, strKeyName))
 m_listbox.AddString(strKeyName);

See Also

SECRegistry  EnumerateValues