-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUnit2.pas
64 lines (53 loc) · 1.47 KB
/
Unit2.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,Registry;
type
TForm2 = class(TForm)
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
Button1: TButton;
procedure FormShow(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
function GetLanguage : string;
Var
Language:string;
Registre : TRegistry;
begin
Registre:=TRegistry.Create;
Registre.RootKey:=HKEY_CURRENT_USER;
Registre.OpenKey('SOFTWARE\Ledadu\Cronos Rename',False);
GetLanguage:=Registre.ReadString('Language');
Registre.Free;
end;
procedure TForm2.Button1Click(Sender: TObject);
var
Language: string;
Registre : TRegistry;
begin
Registre:=TRegistry.Create;
Registre.RootKey:=HKEY_CURRENT_USER;
Registre.OpenKey('SOFTWARE\Ledadu\Cronos Rename',False);
if RadioButton1.Checked then Registre.WriteString('Language','FR');
if RadioButton2.Checked then Registre.WriteString('Language','EN');
Registre.Free;
self.Close
end;
procedure TForm2.FormShow(Sender: TObject);
begin
Left:=(Screen.Width-Width) div 2;
Top:=(Screen.Height-Height) div 2;
if GetLanguage='FR' then RadioButton1.Checked:=true;
if GetLanguage='EN' then RadioButton2.Checked:=true;
end;
end.