Ler e gravar no Registro do Windows
//Gravar um valor
procedure TForm1.Button2Click(Sender: TObject);
var
Reg : TRegistry;
begin
Reg := TRegistry.Create;
try
Reg.RootKey := HKEY_CURRENT_USER;
Reg.OpenKey('Teste',True);
Reg.WriteString('TesteValor',edit1.Text);
finally
Reg.CloseKey;
Reg.Free;
inherited;
end;
end;
//Ler um valor
procedure TForm1.Button1Click(Sender: TObject);
var
Reg : TRegistry;
begin
Reg := TRegistry.Create;
try
Reg.RootKey := HKEY_CURRENT_USER;
Reg.OpenKey('Teste',False);
ShowMessage(Reg.ReadString('TesteValor'));
finally
Reg.CloseKey;
Reg.Free;
inherited;
end;
end;