IRegistryKey.CreateSubKey

Syntax

CreateSubKey(SubKeyName: String): IRegistryKey;

Parameters

SubKeyName. Value of the subkey that should be created.

Description

The CreateSubKey method creates a registry subkey, which name is sent by input parameter.

Comments

If the created subkey already exists, the method returns access to the objects contained in it.

Example

Add a link to the Registry system assembly.

Sub UserProc;
Var
    RegKey, SubKey: IRegistryKey;
Begin
    RegKey := RegistryClass.CurrentUser;
    SubKey := RegKey.CreateSubKey("Software\MyProject");
    SubKey.CreateSubKey("Params");
    SubKey.CreateSubKey("Fonts");
End Sub UserProc;

After executing the example the MyProject subkey is created in the registry key [HKEY_CURRENT_USER\Software], and contains two subkeys - Params and Fonts.

See also:

IRegistryKey