# Registry Support
The `System.Registry` unit provides access to the Windows Registry.
## Root Keys
| Constant | Description |
| :--- | :--- |
| `HKEY_CLASSES_ROOT` | HKEY_CLASSES_ROOT |
| `HKEY_CURRENT_USER` | HKEY_CURRENT_USER |
| `HKEY_LOCAL_MACHINE` | HKEY_LOCAL_MACHINE |
| `HKEY_USERS` | HKEY_USERS |
| `HKEY_CURRENT_CONFIG` | HKEY_CURRENT_CONFIG |
## TRegistry Class
| Method | Description |
| :--- | :--- |
| `CreateKey(path)` | Creates a new key. |
| `DeleteKey(path)` | Deletes a key and its subkeys. |
| `ReadValue(root, path, name, def)` | Reads a value from the specified key. |
| `WriteValue(root, path, name, val)` | Writes a value to the specified key. |
| `DeleteValue(root, path, name)` | Deletes a specific value. |
| `SubKeys(root, path)` | Returns an `array of String` containing subkey names. |
| `ValueNames(root, path)` | Returns an `array of String` containing value names. |
```pascaluses System.Registry;
var val := Registry.ReadValue(HKEY.CurrentUser, 'Software\MyApp', 'Version', '1.0');
PrintLn('Version: ' + val);
// OUTPUT
// Version: 1.0.0```
Registry Support
The System.Registry unit provides access to the Windows Registry.
| Constant |
Description |
HKEY_CLASSES_ROOT |
HKEY_CLASSES_ROOT |
HKEY_CURRENT_USER |
HKEY_CURRENT_USER |
HKEY_LOCAL_MACHINE |
HKEY_LOCAL_MACHINE |
HKEY_USERS |
HKEY_USERS |
HKEY_CURRENT_CONFIG |
HKEY_CURRENT_CONFIG |
| Method |
Description |
CreateKey(path) |
Creates a new key. |
DeleteKey(path) |
Deletes a key and its subkeys. |
ReadValue(root, path, name, def) |
Reads a value from the specified key. |
WriteValue(root, path, name, val) |
Writes a value to the specified key. |
DeleteValue(root, path, name) |
Deletes a specific value. |
SubKeys(root, path) |
Returns an array of String containing subkey names. |
ValueNames(root, path) |
Returns an array of String containing value names. |
var val := Registry.ReadValue(HKEY.CurrentUser, 'Software\MyApp', 'Version', '1.0');
PrintLn('Version: ' + val);