Share via


IRAPISession::CeRegDeleteKey

Send Feedback

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

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 lpSubKey parameter 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 Values

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

Remarks

If the method succeeds, IRAPISession::CeRegDeleteKey removes 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::CeRegCreateKeyEx or IRAPISession::CeRegOpenKeyEx function.

Requirements

OS Versions: Windows CE 5.01 and later.
Header: Rapi2.h.
Link Library: Ole32.lib, Rapiuuid.lib

See Also

IRAPISession::IUnknown | IRAPISession::CeRegCreateKeyEx | IRAPISession::CeRegOpenKeyEx | IRAPISession::CeRegSetValueEx

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.