OpenSubKey(SubKeyName: String; Writable: Boolean): IRegistryKey;
SubKeyName. Registry subkey name.
Writable. The parameter that determines whether the subkey is read-only.
The OpenSubKey method opens registry subkey.
To change subkey data, set the Writable parameter to True.
Add a link to the Registry system assembly.
Sub UserProc;
Var
RegKey, SubKey: IRegistryKey;
Begin
RegKey := RegistryClass.CurrentUser;
SubKey := RegKey.OpenSubKey("Software\MyProject\Params", True);
If SubKey.ValueExists("Param1") Then
SubKey.DeleteValue("Param1")
End If;
End Sub UserProc;
After executing the example the Param1 parameter is searched in the registry subkey [HKEY_CURRENT_USER\Software\MyProject\Params]. If the parameter exists, it is deleted.
See also: