DECLAREINTEGER RegDeleteKey IN advapi32;
[in] Handle to an open key.
[in] Pointer to a null-terminated string specifying the name of the key to be deleted.
If the function succeeds, the return value is ERROR_SUCCESS (0).
The key must have been opened with the DELETE access right.
hKey handle is returned by the RegCreateKeyEx or RegOpenKeyEx function, or it can be one of the following predefined keys:
The subkey to be deleted must not have subkeys. To delete a key and all its subkeys, you need to recursively enumerate the subkeys and delete them individually. To recursively delete keys, use the SHDeleteKey function.