●GetDataInfo method
Function GetDataInfo(const ValueName:String;Var Value:TRegDataInfo):Boolean;
TregDataType=(rdunknown,rdstring,rdexpandstring,rdexpandstring,rdinterger,rdbinary);
TregDataInfo=record
Regdata:TRegDataType;data type
dataSize:integer;data size
end
valuename: The name of the data value associated with the current key
value: Information about the returned data. If it is of type rdstring or rdexpandstring, the data size includes the null terminating character at the end of the string.
Returns True if successful, False if failed, and Value is zeros
rdexpandstring: is a string containing environment variables; such as "%PATH%".
●CreateKey method
Function CreateKey(const Key:string):Boolena;
Create a new key named Key. Key can be an absolute or relative name. The absolute name starts with a backslash "". The relative name is to create a new subkey of the current key. New has no value.
Returns True if successful, otherwise returns False. If the key already exists, it will have no effect.
●DeleteKey method
Function DeleteKey(const Key:string):Boolean;
If you delete a key and associated data, the neutron keys will also be deleted in win95. NT neutron keys must be deleted one by one.
●DeleteValue method
Function DeleteValue (const Name:string):Boolean;
Delete a data value name specified in the current key.
●GetDataSize method
Function GetDataSize(const ValueName:string):integer;
Returns the size of a specified value ValueName data in the current key.
●GetDataType method
Function GetDataType(const Valuename;string):TRegDataType;
Returns the type of a specified value Valuename data in the current key.
●GetKeyInfo method
Function GetKeyInfo(var value:TRegkeyinfo):Boolean;
Returns the current key information, which is in value.
TRegkeyinfo=record
maxsubkeylen:integer;The longest value of the subkey name (bytes)
numvalues:integer; number of key values
maxvaluelen; length of the longest key value name
Filetime:TFileTime; the time of the last change
end;
●Getkeynames method
PRocedure Getkeynames(strings:Tsrtings);
Returns the name list string of all subkeys of the current key.
●Getvaluenames
Procedure Getvaluenames(strings:Tstrings);
Returns a list of all key value names for the current key.
●Hassubkeys method
Function hassubKeys:Boolean;
Determines whether the current key has subkeys, returns True if so, otherwise returns False.
●keyExists method
Function KeyExists(const Key:string):Boolean;
Determine whether the specified key exists.
●LoadKey method
Function LoadKey(const Key,fileNmae:string):Boolean;
Create new under root key
Load the registration information from a file into the subkey. The file registration information contains the data value name, subkey and data.
LoadKey simplifies the creation of a key, subkeys, key values and data in one person's operation. All these are called a set, and creating them individually. Different applications can read a set of data in a file, which is done by the user. On-the-fly resetting has special uses.
Key is the name of the subkey to be created
FileName: is the location of the file. The specified file must be previously created using the SaveKey function or RegSaveKey API function. The file name cannot include the extension.
●OpenKey method
Function OpenKey(const Key:string;cancreate:Boolean):Boolean;
Use this function to specify a key as the current key. If the key is nil, the current key will be set to the root key.
Cancreate determines whether to create the specified key if it does not exist. The key value of the key created by this function will be undefined.
If opened or created successfully, this function returns True.
●OpenKeyReadOnly method
function OpenKeyReadOnly(const Key: String): Boolean;
Open the key specified by the Key value in read-only mode.
●CloseKey method
procedure CloseKey;
This method should be used to close a key when it is no longer in use.
●MoveKey method
procedure MoveKey(const OldName, NewName: String; Delete: Boolean);
This method moves or copies a key to a new location and changes the key's name to NewName.
Under Win95/98 the subkey and data will be moved or copied to the new location together. Under NT the subkey must be explicitly moved or customized using MoveKey.
●How to read data
function ReadBinaryData(const Name: String; var Buffer; BufSize: Integer):Integer;
function ReadBool(const Name: String): Boolean;
function ReadCurrency(const Name: String): Currency;
function ReadDate(const Name: String): TDateTime;
function ReadDateTime(const Name: String): TDateTime;
function ReadFloat(const Name: String): Double;
function ReadInteger(const Name: String): Integer;
function ReadString(const Name: String): String;
function ReadTime(const Name: String): TDateTime;
The above method reads the key value data of the corresponding data type from the current primary key. If the types do not match, an exception will be generated.
●RegistryConnect method
function RegistryConnect(const UNCName: String): Boolean;
To establish a connection with the registry of another computer, the Rootkey attribute should be set to HKEY_USERS or HKEY_LOCAL_MACHINE before establishing the connection.
UNCName is the name of another computer. The format is:/computername
If UNCName is nil, the local computer will be opened.