i'm making a simple program to retvive some registery values of internet explorer but i'm stuck with the regenumkeyex function,in the code below the program should retvive the subkeys under internet explorer registery key (which is 21 keys) and add it to a combo box so the user choose which subkey he want to enter to change values in it but when i run the program only this values is added to the combo box
1-default html editor
2-desktop
3-desktop <----twice
so can you please tell me what is wrong with this code ? (why the "desktop" entry is cloned and why dosen't it retvive all the 21 subkeys)/
btw...i have some doubts about the second paramter in regenumkeyex function (the subkey index)
Code:
HKEY iesub;
LONG retsubkeys;
DWORD i;
DWORD subsize=255;
char subkeys[255];
if (RegOpenKeyEx(HKEY_CURRENT_USER,"software\\microsoft\\internet explorer",0,KEY_ALL_ACCESS,&iesub)==ERROR_SUCCESS)
{
for (i=0,retsubkeys=ERROR_SUCCESS;retsubkeys==ERROR_SUCCESS;i++)
{
retsubkeys=RegEnumKeyEx(iesub,i,subkeys,&subsize,NULL,NULL,NULL,NULL );
m_combo.AddString (subkeys);
}
}