Skip to content

Commit 530811e

Browse files
committed
misc
1 parent 29a07ff commit 530811e

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

src/unit1.pas

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ TForm1 = class(TForm)
2222
ExecPath: string;
2323
procedure Doing(const filename: string);
2424
procedure AfterShow(Data: PtrInt);
25+
procedure BeforeDoing;
26+
procedure AfterDoing;
2527
public
2628
{ public declarations }
2729
end;
@@ -55,11 +57,11 @@ procedure TForm1.FormDropFiles(Sender: TObject; const FileNames: array of String
5557
var
5658
s: string;
5759
begin
60+
BeforeDoing;
5861
for s in FileNames do begin
5962
Doing(s);
6063
end;
61-
Windows.MessageBeep(0);
62-
Close;
64+
AfterDoing;
6365
end;
6466

6567
procedure TForm1.FormShow(Sender: TObject);
@@ -75,14 +77,27 @@ procedure TForm1.AfterShow(Data: PtrInt);
7577
i: integer;
7678
begin
7779
if ParamCount > 0 then begin
80+
BeforeDoing;
7881
for i:=1 to ParamCount do begin
7982
Doing(ParamStr(i));
8083
end;
81-
Windows.MessageBeep(0);
82-
Close;
84+
AfterDoing;
8385
end;
8486
end;
8587

88+
procedure TForm1.BeforeDoing;
89+
begin
90+
FormStyle:=fsNormal;
91+
BorderIcons:=BorderIcons+[biMinimize];
92+
end;
93+
94+
procedure TForm1.AfterDoing;
95+
begin
96+
Label1.Caption:=#$0d#$0d'処理が終了しました。';
97+
Windows.MessageBeep(0);
98+
Close;
99+
end;
100+
86101
procedure TForm1.Doing(const filename: string);
87102
var
88103
sl: TStringList;
@@ -120,7 +135,7 @@ procedure TForm1.Doing(const filename: string);
120135
sl.Free;
121136
end;
122137
except
123-
Label1.Caption:='エラーが発生しました';
138+
Label1.Caption:=#$0d#$0d'エラーが発生しました';
124139
end;
125140
end;
126141

0 commit comments

Comments
 (0)