Hello friends,

I want to read all subkeys under a particular key.

I got the function and tried. The codes are : -


// for enumerating the subkeys

int i = 0;
char subKeyName[SIZE] ;
memset(subKeyName, 0, SIZE);
DWORD Buffsize = SIZE;
PFILETIME time = NULL;


cout<<subKeyName;
do
{

if(RegEnumKeyEx(HKEY_CURRENT_USER, i, subKeyName, &Buffsize, 0, NULL, NULL, time) != ERROR_NO_MORE_ITEMS)

{
cout<<subKeyName<<"\n";
i++;
}
else
break;

}while(1);

The thing is it shows all subkey names but after showing first 3 - 4 names corectly the subsequent names are shown of having only 4-5 characters . e.g If subkey is Console then it is shown as Conso.
Any help ?