please dont rip this site Prev Next

RegDeleteKey info  Overview  Group

Windows 95: The RegDeleteKey function deletes a subkey and all its descendants.

Windows NT: The RegDeleteKey function deletes the specified subkey. The subkey to be deleted must not have subkeys.

LONG RegDeleteKey(

    HKEY hKey,

// handle of open key

    LPCTSTR lpSubKey 

// address of name of subkey to delete



Identifies a currently open key or one of the following predefined reserved handle values:

Windows 95 only: HKEY_DYN_DATA 

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

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

Windows NT: The specified key must not have subkeys.

Return Values

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.


If the function succeeds, RegDeleteKey removes the specified key from the registry. The entire key, including all of its values, is removed.

To open the key, use the RegCreateKeyEx or RegOpenKeyEx function. Do not use the RegCreateKey or RegOpenKey functions.

See Also

RegCloseKey, RegCreateKeyEx, RegOpenKeyEx 

file: /Techref/os/win/api/win32/func/src/f72_5.htm, 3KB, , updated: 2000/4/7 12:19, local time: 2024/4/21 17:11,

 ©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF=""> RegDeleteKey</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.

Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?


Welcome to!


Welcome to!