-
Notifications
You must be signed in to change notification settings - Fork 0
/
About.pas
81 lines (65 loc) · 1.85 KB
/
About.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
{ ************************************************************************
NetTime is copyrighted by Graham Mainwaring. Permission is hereby
granted to use, modify, redistribute and create derivative works
provided this attribution is not removed. I also request that if you
make any useful changes, please e-mail the diffs to [email protected]
so that I can include them in an 'official' release.
************************************************************************ }
unit About;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls, StdCtrls, Buttons, jpeg;
type
TfrmAbout = class(TForm)
Image1: TImage;
btnOk: TButton;
lblVersion: TLabel;
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
end;
procedure DoSplash;
implementation
{$R *.DFM}
procedure DoSplash;
var
fA: TfrmAbout;
start: longword;
begin
fA := TfrmAbout.Create(Application);
fA.BorderStyle := bsNone;
fA.Caption := '';
fA.btnOK.Visible := false;
fA.Width := fA.Image1.Width;
fA.Height := fA.Image1.Height;
fA.Show;
start := GetTickCount;
while (GetTickCount - start) < 2500 do
Application.ProcessMessages;
fA.Release;
Application.ProcessMessages;
end;
procedure TfrmAbout.FormCreate(Sender: TObject);
var
VerSize: cardinal;
VerHandle: cardinal;
VerPtr: pointer;
VerPchar: pchar;
VerLen: cardinal;
begin
VerSize := GetFileVersionInfoSize(pchar(ParamStr(0)),VerHandle);
if VerSize = 0 then
exit;
VerPtr := pointer(GlobalAlloc(GPTR,VerSize));
try
GetFileVersionInfo(pchar(ParamStr(0)),VerHandle,VerSize,VerPtr);
if not VerQueryValue(VerPtr,'\StringFileInfo\040904E4\FileVersion',
pointer(VerPchar),VerLen) then
exit;
lblVersion.Caption := 'Version '+VerPchar;
finally
GlobalFree(cardinal(VerPtr));
end;
end;
end.