DeleteRegistryKey method


Prototype

DeleteRegistryKey Proto hKey:HKEY, lpszSubKey:LPSTR

Syntax

Invoke DeleteRegistryKey, hKey, lpszSubKey

Function

Deletes a registry subkey and all its descendants.

Parameters

hKey

Handle to one of the following predefined keys:

ecClassesRoot
ecCurrentUser
ecLocalMachine
ecUsers
ecPerformanceData
ecCurrentConfig
ecDynData

lpszSubKey

Pointer to the effective address of a null-terminated string that names the path of the subkey to be deleted.

Return value

Eax returns TRUE if successfull, or FALSE if not.


REMARKS: The DeleteRegistryKey method expects lpszSubKey to be a Unicode string if the application is running as Unicode, or an ANSI string if not (see the IsAppUnicode method). You can call DeleteRegistryKeyA to delete ANSI keys in Unicode applications, or DeleteRegistryKeyW to delete Unicode keys in ANSI applications.