regedit - delete key patch

Dimitrie O. Paun dpaun at rogers.com
Sun Feb 15 23:53:20 CST 2004


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...

-- 
Dimi.




More information about the wine-devel mailing list