unit Unit1 interface uses Windows Messages SysUtils Variants Classes G

 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
65
66
67
68
69
70
71
72
73
74
75
76
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;
type
TForm1 = class(TForm)
RadioGroup1: TRadioGroup;
butRun: TButton;
Edit1: TEdit;
procedure butRunClick(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure butRunEnter(Sender: TObject);
procedure butRunKeyPress(Sender: TObject; var Key: Char);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
const
configaini = 'C:\Program Files\QIP\configa.ini';
configsini = 'C:\Program Files\QIP\configs.ini';
qip = 'C:\Program Files\QIP\qip.exe';
inidir = 'C:\Program Files\QIP\Users\...\';
implementation
{$R *.dfm}
procedure TForm1.butRunClick(Sender: TObject);
begin
If RadioGroup1.ItemIndex = 0 then
begin
DeleteFile(inidir + 'config.ini');
CopyFile(configsini, inidir + 'config.ini', true);
end;
If RadioGroup1.ItemIndex = 1 then
begin
DeleteFile(inidir + 'config.ini');
CopyFile(configaini, inidir + 'config.ini', true);
end;
Edit1.CopyToClipboard; Edit1.SelectAll; Edit1.CopyToClipboard;
WinExec(qip, SW_SHOW);
end;
procedure TForm1.FormShow(Sender: TObject);
begin
RadioGroup1.ItemIndex:= 0;
end;
procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Edit1.Text:= '0'; Edit1.SelectAll; Edit1.CopyToClipboard;
end;
procedure TForm1.butRunEnter(Sender: TObject);
begin
//butRunClick(Sender);
end;
procedure TForm1.butRunKeyPress(Sender: TObject; var Key: Char);
begin
butRunClick(Sender);
end;
end.