A version of this page is also available for
This function deletes a specified registry key and all its subkeys.
A remote application interface (RAPI) version of this function exists called CeRegDeleteKey (RAPI).
LONG RegDeleteKey( HKEY hKey, LPCWSTR lpSubKey );
[in] Handle to a currently open key or one of the following predefined reserved handle values:
The key specified by the lpSubKey parameter must be a subkey of the key identified by this parameter.
[in] Pointer to a null-terminated string specifying the name of the key to delete. This parameter cannot be set to NULL.
ERROR_SUCCESS indicates success. A nonzero error code defined in Winerror.h indicates failure. To get a generic description of the error, call the FormatMessage funciton with the FORMAT_MESSAGE_FROM_SYSTEM flag set. The message resource is optional, so FormatMessage might fail.
If this function succeeds, it removes the specified key, including all its values and subkeys, from the registry. An application cannot call this function for a key that an application currently has open.
|Windows Embedded CE||Windows CE 1.0 and later|
|Windows Mobile||Windows Mobile Version 5.0 and later|