RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
ComObj.DeleteRegKey Function

Deletes a single key that is a subkey of HKEY_CLASSES_ROOT from the system registry.

Pascal
procedure DeleteRegKey(const Key: string; RootKey: DWord = HKEY_CLASSES_ROOT);
C++
DeleteRegKey(const AnsiString Key, DWord RootKey = HKEY_CLASSES_ROOT);

Use DeleteRegKey to update the system registry.

Note: DeleteRegKey is useful for implementing the UpdateRegistry method of a class factory.
DeleteRegKey deletes the subkey of RootKey that is passed in as the Key parameter.  

Key must specify a null-terminated string, which is the name of the key to delete. It cannot be NULL. The Key to delete must not have subkeys. 

RootKey is the top-level key under which the key to delete appears. It defaults to HKEY_CLASSES_ROOT. 

If DeleteRegKey succeeds it removes the entire specified key from the registry, including all of its values. An exception is raised if it fails. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!