hi all. I am trying to enumerate all of the subkeys of a key and then all of the subkeys of each subkey and so on....i dont know if u get my point.For example : enumerate HKEY_CURRENT_USER: AppEvents,Console,Control Panel.....and then enumerate all of subkeys of AppEvents,COnsole....an then every subkey of AppEvents,and so on: here is my code:
void Registry::enum_key(HKEY Hkey , DWORD level)
{
int i = 0;
while(RegEnumKeyEx(Hkey , i , name , &size , 0 , 0 , 0 , &filetime) != ERROR_NO_MORE_ITEMS)
{
cout << i << ":" << name << endl;
i++;
size = sizeof(name);
HKEY subhkey;
if(open_key(hkey , name))
{
enum_key(subhkey , level + 1);
RegCloseKey(subhkey);
}
}
}
but what he does is enumerate twice the subkeys of the HKEY_CURRENT_USER.