RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TRegistry.CreateKey Method

Creates a new key in the registry.

Pascal
function CreateKey(const Key: string): Boolean;
C++
__fastcall Boolean CreateKey(const AnsiString Key);

Use CreateKey to add a new key to the registry. Key is the name of the key to create. Key can be an absolute or relative name. An absolute key begins with a backslash (\) and is a subkey of the root key. A relative key is a subkey of the current key. 

CreateKey returns true if key creation is successful. On error, an exception is raised. Attempting to create a key that already exists has no effect. 

CreateKey creates only non-volatile keys. If you need to create volatile keys on Windows NT, you must call the Windows API directly. 

CreateKey creates keys with a security access of KEY_ALL_ACCESS. If you need to create keys with more restricted access, you must call the Windows API directly. 

A key created by CreateKey has no values. To set key values, use the WriteCurrency, WriteBinaryData, WriteBool, WriteDate, WriteDateTime, WriteFloat, WriteInteger, WriteString, or WriteTime procedures. 

 

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