On February 15, 2004 06:07 am, Zimler Attila wrote:
+BOOL DeleteKey(HWND hwnd, HKEY hKeyRoot, LPCTSTR keyPath) +{
- BOOL result = FALSE;
- LONG lRet;
- HKEY hKey;
- lRet = RegOpenKeyEx(hKeyRoot, keyPath, 0, KEY_SET_VALUE, &hKey);
- if (lRet != ERROR_SUCCESS) return FALSE;
- if (messagebox(hwnd, MB_YESNO | MB_ICONEXCLAMATION,
IDS_DELETE_BOX_TITLE, IDS_DELETE_BOX_TEXT, keyPath) != IDYES) + goto done;
- lRet = RegDeleteKey(hKeyRoot, keyPath);
- if (lRet != ERROR_SUCCESS) {
error(hwnd, IDS_BAD_KEY, keyPath);
goto done;
- }
- result = TRUE;
+done:
- RegCloseKey(hKey);
- return result;
+}
Is RegDeleteKey() working to delete an entire tree? I haven't checked the documentation, but I thought we needed to use shell32.SHRegDeleteKey() instead...
Dimitrie O. Paun wrote:
On February 15, 2004 06:07 am, Zimler Attila wrote:
+BOOL DeleteKey(HWND hwnd, HKEY hKeyRoot, LPCTSTR keyPath) +{
- BOOL result = FALSE;
- LONG lRet;
- HKEY hKey;
- lRet = RegOpenKeyEx(hKeyRoot, keyPath, 0, KEY_SET_VALUE, &hKey);
- if (lRet != ERROR_SUCCESS) return FALSE;
- if (messagebox(hwnd, MB_YESNO | MB_ICONEXCLAMATION,
IDS_DELETE_BOX_TITLE, IDS_DELETE_BOX_TEXT, keyPath) != IDYES) + goto done;
- lRet = RegDeleteKey(hKeyRoot, keyPath);
- if (lRet != ERROR_SUCCESS) {
error(hwnd, IDS_BAD_KEY, keyPath);
goto done;
- }
- result = TRUE;
+done:
- RegCloseKey(hKey);
- return result;
+}
Is RegDeleteKey() working to delete an entire tree? I haven't checked the documentation, but I thought we needed to use shell32.SHRegDeleteKey() instead...
I will check up for differences, but this deletes the entire key with subkeys and values from the marked key.
Dimitrie O. Paun wrote:
Is RegDeleteKey() working to delete an entire tree? I haven't checked the documentation, but I thought we needed to use shell32.SHRegDeleteKey() instead...
The behaviour of RegDeleteKey differs between NT and 9x, so SHDeleteKey and SHDeleteEmptyKey were created to make things consistent... see the remarks section in the MSDN page for RegDeleteKey for more details:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/bas...
Mike
On Mon, 16 Feb 2004, Mike McCormack wrote:
The behaviour of RegDeleteKey differs between NT and 9x, so SHDeleteKey and SHDeleteEmptyKey were created to make things consistent... see the remarks section in the MSDN page for RegDeleteKey for more details:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/bas...
I guess that's fine than. Our RegDeleteKey() and ReactOS's RegDeleteKey() behave properly, so there's no point in an additional dependency just so our regedit can delete trees recursively on Win9x. Attila, I think your patch is fine as is.
"Dimitrie O. Paun" dimi@intelliware.ca writes:
I guess that's fine than. Our RegDeleteKey() and ReactOS's RegDeleteKey() behave properly, so there's no point in an additional dependency just so our regedit can delete trees recursively on Win9x. Attila, I think your patch is fine as is.
No, it will break if you run with version set to NT. If you want it to always work right you have to use SHDeleteKey or do the recursion yourself.