System.Win.Registry.TRegistry.RestoreKey

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function RestoreKey(const Key, FileName: string): Boolean;

C++

bool __fastcall RestoreKey(const System::UnicodeString Key, const System::UnicodeString FileName);

Properties

Type Visibility Source Unit Parent
function public
System.Win.Registry.pas
System.Win.Registry.hpp
System.Win.Registry TRegistry

Description

Reopens the specified key, and overwrites any information contained in this key and its subkeys keys with registry data stored in a hive file.

Call RestoreKey to open the specified key with a security access value of KEY_ALL_ACCESS and overwrite any information in the key and its subkeys with registry data stored in a hive file. A hive is a discrete collection of keys, subkeys, and values that is rooted at the top of the registry hierarchy.

Key is the name of the key to open. FileName is the name of the file containing the hive information.

If RestoreKey successfully reads and copies the registry information in FileName to the specified key, the return value of RestoreKey is true and the key is closed.

Note: The file specified by FileName parameter must be created with the SaveKey function, or by directly calling the Windows 95/NT RegSaveKey API function. Under the FAT file system FileName cannot have an extension.

See Also