RegDeleteKeyEx (Api-ms-win) function
[This function is exported from Api-ms-win-core-localregistry-l1-1-0.dll in Windows 7 and Windows Server 2008 R2. This may change in subsequent versions. Instead of calling this function directly in Api-ms-win-core-localregistry-l1-1-0.dll, call the function through Advapi32.dll. See RegDeleteKeyEx.]
Deletes a subkey and its values from the specified platform-specific view of the registry.
LONG WINAPI RegDeleteKeyEx( _In_ HKEY hKey, _In_ LPCTSTR lpSubKey, _In_ REGSAM samDesired, _Reserved_ DWORD Reserved );
- hKey [in]
A handle to an open registry key. The access rights of this key do not affect the delete operation. For more information about access rights, see Registry Key Security and Access Rights.
- lpSubKey [in]
The name of the key to be deleted. This key must be a subkey of the key specified by the value of the hKey parameter.
The function opens the subkey with the DELETE access right.
Key names are not case sensitive.
The value of this parameter cannot be NULL.
- samDesired [in]
An access mask the specifies the platform-specific view of the registry.
Delete the key from the 32-bit registry view.
Delete the key from the 64-bit registry view.
This parameter is reserved and must be zero.
If the function succeeds, the return value is ERROR_SUCCESS.
If the function fails, the return value is a nonzero error code defined in Winerror.h. You can use the FormatMessage function with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a generic description of the error.
Minimum supported client
|Windows 7 [desktop apps only]|
Minimum supported server
|Windows Server 2008 R2 [desktop apps only]|
Unicode and ANSI names
|RegDeleteKeyExW (Unicode) and RegDeleteKeyExA (ANSI)|