Simple DeleteRegKey fail

I cant get my head around this one
My regdelete was working awhile ago
but i have added heaps more to my code an now i dont know if i changed anything to this.

i set a breakpoint just after my deleteregkey
an then check the reg but its not deleted

programs running as admin.

1
2
3
			if (RegOpenKeyEx(HKEY_CURRENT_USER, "SOFTWARE\\", 0, KEY_ALL_ACCESS, &HKey) == ERROR_SUCCESS)
				RegDeleteKey(HKey, PROGNAME);
			RegCloseKey(HKey);


edit:
i think i found out why with more searching
i think its because the key im trying to delete has sub keys
so is
 
RegDeleteTree

right function to use?
Last edited on
You should try this example:
http://msdn.microsoft.com/en-us/library/ms724235%28VS.85%29.aspx

You can also use SHDeleteKey() if your program does not require Vista or later as RegDeleteTree() requires:
http://msdn.microsoft.com/en-us/library/windows/desktop/bb773486%28v=vs.85%29.aspx
Topic archived. No new replies allowed.