RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TRegistry.ReplaceKey Method

Replaces the hive file backing a key and all its subkeys with a hive stored in a different file, so that when the system is next started, the key and subkeys will have the values stored in the new file.

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

Call ReplaceKey to replace the hive file backing a key and all its subkeys with a different hive file. A hive is a discrete collection of keys, subkeys, and values that is rooted at the top of the registry hierarchy. 

FileName indicates the name of the file containing the new key and subkey information. BackUpFileName is the name of a backup file used to store the current key and subkey information before it is overwritten. 

ReplaceKey returns true if it is successful.

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) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!