Deletes a subkey and all its descendants. The function will remove the key and all of the key's values from the registry.
Syntax
LSTATUS SHDeleteKey(
HKEY hkey,
LPCTSTR pszSubKey
);
Parameters
- hkey
-
[in] A handle to the currently open key, or any of the following predefined values.
HKEY_CLASSES_ROOTHKEY_CURRENT_CONFIGHKEY_CURRENT_USERHKEY_DYN_DATA (MicrosoftWindows95 only)HKEY_LOCAL_MACHINEHKEY_PERFORMANCE_DATA (Microsoft Windows NTonly)HKEY_USERS
- pszSubKey
-
[in] The address of a null-terminated string specifying the name of the key to delete.
Return Value
Returns ERROR_SUCCESS if successful, or a nonzero error code defined in Winerror.h otherwise. You can use the FormatMessage function with the FORMAT_MESSAGE_FROM_SYSTEM flag to retrieve a generic description of the error.
Function Information
| Minimum DLL Version | shlwapi.dll version 4.71 or later |
|---|
| Custom Implementation | No |
|---|
| Header | shlwapi.h |
|---|
| Import library | shlwapi.lib |
|---|
| Minimum operating systems |
Windows 2000, Windows NT 4.0 with Internet Explorer 4.0, Windows 98, Windows 95 with Internet Explorer 4.0 |
|---|
| Unicode | Implemented as
ANSI and Unicode versions. |
|---|