CreateSubKey(SubKeyName: String): IRegistryKey;
SubKeyName. Value of the subkey that should be created.
The CreateSubKey method creates a registry subkey, which name is sent by input parameter.
If the created subkey already exists, the method returns access to the objects contained in it.
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: