2.2.5.3.1 Registry::DelKey

Description

Deletes a subkey.

Syntax

BOOL DelKey( LPCSTR lpSubKey )

Parameters

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

Return

FALSE if the key does not exist or it fails to remove it.

Examples

EX1

void Registry_DelKey_ex1()
{
    Registry myRegAccess(HKEY_CURRENT_USER);
    
    string strKey = GetRegKey() + "\\Dialogs\\Set Values";
    if( myRegAccess.HasKey(strKey) )
    {
        myRegAccess.DelKey(strKey);
        out_str("Delete key, done!");
    }
}

Remark

See Also

Registry::Registry, Registry::HasKey, GetRegKey

Header to Include

origin.h