Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This method deletes a subkey from the specified registry key on a remote Windows Embedded CE–based device. The subkey to be deleted cannot have any subkeys.

Syntax

LONG CeRegDeleteKey( 
  HKEY 
hKey, 
  LPCWSTR 
lpszSubKey 
);

Parameters

hKey

[in] Handle to a currently open key or one of the following predefined reserved handle values:

HKEY_CLASSES_ROOT

HKEY_CURRENT_USER

HKEY_LOCAL_MACHINE

HKEY_USERS

The key specified by the lpSubKeyparameter must be a subkey of the key identified by hKey.

lpszSubKey

[in] Pointer to a null-terminated string specifying the name of the key to delete. This parameter cannot be NULL.

Return Value

ERROR_SUCCESS indicates success. A nonzero error code defined in Winerror.h indicates failure. To get a generic description of the error, call FormatMessagewith the FORMAT_MESSAGE_FROM_SYSTEM flag set.

Remarks

If the method succeeds, IRAPISession::CeRegDeleteKeyremoves the specified key from the registry. The entire key, including all of its values, is removed. An application cannot delete a key that is currently open by another application.

To open a registry key, use the IRAPISession::CeRegCreateKeyExor IRAPISession::CeRegOpenKeyExfunction.

Requirements

Header rapi2.h
Library ole32.lib, rapiuuid.lib
Windows Embedded CE Windows Embedded CE 6.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also