RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
ComObj.CreateRegKey Function

Creates or opens a registry key that is a subkey of HKEY_CLASSES_ROOT.

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

ComObj

CreateRegKey creates or opens the key specified by the Key parameter. If the key does not already exist in the registry, CreateRegKey creates it, otherwise CreateRegKey opens it.

Note: CreateRegKey is useful for implementing the UpdateRegistry method of a class factory.
Key specifies a string that cannot begin with the backslash character ('\'). It must be a subkey of RootKey. 

When the key is created, additional value and type information for the specified key can be set from the parameters passed to CreateRegKey. 

ValueName points to a string that specifies the name of the subkey associated with value. 

Value specifies the data to be stored with the specified value name. 

RootKey is the top-level registry key under which the new key is created or opened. If omitted, it is HKEY_CLASSES_ROOT. 

If CreateRegKey is not successful, an EOleRegistrationError exception is raised. 

 

EOleRegistrationError 

TRegistry 

TRegistryIniFile

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!