INtime SDK Help
RegDeleteKey (iwin32)
INtime SDK v7 > About INtime > Alternate APIs > iwin32 API > iwin32 API > RegDeleteKey (iwin32)

Deletes the specified subkey from the registry. The entire key, including all of its values, is removed. The subkey cannot have subkeys.

LONG RegDeleteKey(
    HKEY hKey,
    LPCTSTR lpSubKey
);

Parameters

hKey
Handle to a currently open key or one of the following predefined reserved handle values:
HKEY_CLASSES_ROOT
HKEY_CURRENT_CONFIG
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_USERS
HKEY_PERFORMANCE_DATA

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

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

The specified key cannot have subkeys.

Remarks

If the function succeeds, RegDeleteKey removes the specified key from the registry. The entire key, including all its values, is removed. An application cannot call RegDeleteKey for a key that an application currently has open.

To open the key, use RegCreateKeyEx or RegOpenKeyEx.

Return Values

ERROR_SUCCESS
Success.
A nonzero status code defined in RTWIN32.H
Failure. For extended error information, see GetLastError

Requirements

Versions Defined in Include Link to
INtime 3.0 intime/rt/include/iwin32.h iwin32.h
iwin32rt.h
rt.lib

Note

This function operates in the real-time portion of your application.

See Also

RegCreateKeyEx, RegOpenKeyEx, iwin32 API, iwin32 Overview