I've been trying to delete registry keys, including all their subkeys, without resorting to SHDeleteKey (Which isn't directly Windows 95 compatible). So far I've come up with:-
This manages to delete just one of the main subkeys of a key I'm trying to delete.
int DeleteKey(HKEY hKey, char *szSubKey)
unsigned long ulSize = 255;
DWORD dwIndex = 0;
if (!RegOpenKeyEx(hKey, szSubKey, 0, DELETE | KEY_ENUMERATE_SUB_KEYS, &hKeySub))
while (!RegEnumKeyEx(hKeySub, dwIndex, szKeyDelete, &ulSize, NULL, NULL, NULL, NULL))
ulSize = 255;
Is there anything here that might be problematic or wrong that I'm not seeing?