From RAD Studio API Documentation
Jump to: navigation, search


function OpenKey(const Key: string; CanCreate: Boolean): Boolean;


bool __fastcall OpenKey(const System::UnicodeString Key, bool CanCreate);


Type Visibility Source Unit Parent
function public
System.Win.Registry TRegistry


Opens a specified key.

Call OpenKey to make a specified key the current key. Key is the name of the key to open. If Key is nil (Delphi) or NULL (C++), the CurrentKey property is set to the key specified by the RootKey property.

CanCreate specifies whether to create the specified key if it does not exist. If CanCreate is true, the key is created if necessary.

Key is opened or created with the security access value specified by the Access property. OpenKey only creates non-volatile keys, A non-volatile key is stored in the registry and is preserved when the system is restarted.

OpenKey returns true if the key is successfully opened or created

See Also

Code Examples