RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TRegistry.RestoreKey Method

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

Pascal
function RestoreKey(const Key: string; const FileName: string): Boolean;
C++
__fastcall Boolean RestoreKey(const AnsiString Key, const AnsiString FileName);

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.
 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!