![]() |
![]() ![]() ![]() |
acStringListContainer component.
|
procedure LoadToRegistry(Reg: TRegistry); overload;
|
procedure LoadToRegistry(const KeyName: String; const RootKey: hKey = HKEY_CURRENT_USER); overload;
|
The LoadToRegistry method loads the strings to the from the registry.
|
|
There is 2 overloaded methods of calling the LoadFromRegisty:
|
1. The registry key must be previously opened and handle to TRegistry object must be passed with Reg parameter (see first example below);
|
2. You must pass the KeyName and the RootKey (HKEY_CURRENT_USER or HKEY_LOCAL_MACHINE) as parameters (see second example below).
|
![]() |
uses Registry;
|
|
procedure TForm1.Button1Click(Sender: TObject);
|
var
|
MyKey: String;
|
Reg: TRegistry;
|
begin
|
MyKey := 'SOFTWARE\My Company Name\My Program Name\StringList';
|
|
Reg := TRegistry.Create;
|
with Reg do
|
try
|
RootKey := HKEY_CURRENT_USER;
|
if OpenKey(MyKey, False) then
|
acStringListContainer1.LoadToRegistry(Reg);
|
finally
|
Free;
|
end;
|
end;
|
procedure TForm1.Button1Click(Sender: TObject);
|
begin
|
acStringListContainer1.LoadToRegistry('SOFTWARE\My Company Name\My Program Name\StringList');
|
StoreToRegistry, SaveToFile and LoadFromFile methods;
|
Strings, Names, Values, MaxSize and Duplicates properties.
|