OpenSubKey(SubKeyName: String; Writable: Boolean): IRegistryKey;
SubKeyName - name of registry subkey.
Writable - parameter that determines whether the subkey is opened in the read-only mode. To change subkey data, set the parameter to True.
The OpenSubKey method opens registry subkey.
Sub Main;
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 Main;
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: