-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAbox.pas
93 lines (75 loc) · 1.74 KB
/
Abox.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
82
83
84
85
86
87
88
89
90
91
92
unit abox;
interface
uses Windows,StdCtrls,Forms,Controls,ExtCtrls,
Classes,SysUtils;
type
TAboutBox = class(TForm)
ProgramIcon: TImage;
ProgramName: TLabel;
VersionCAP: TLabel;
Copyright: TLabel;
Comments: TLabel;
OkBtn: TButton;
RightsCAP: TLabel;
okvir: TBevel;
panel: TPanel;
VrzCAP: TLabel;
InfoCAP: TLabel;
EMAILED: TEdit;
EMAILCAP: TLabel;
procedure FormCreate(Sender: TObject);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
AboutBox: TAboutBox;
procedure ShowAboutBox;
implementation
{$R *.DFM}
uses main;
procedure ShowAboutBox;
begin
with TAboutBox.Create(Application) do
try
ShowModal;
finally
Free;
end;
end;
function GetFileBuildNo : integer;
var
FVersionInfo: PChar;
FVersionInfoSize: DWORD;
QueryLen: UINT;
Dummy: DWORD;
FixedInfoData: PVSFixedFileInfo;
TempFilename: array[0..255] of char;
begin
StrPCopy(TempFileName, Application.ExeName);
FVersionInfoSize := GetFileVersionInfoSize(TempFileName, Dummy);
if FVersionInfoSize = 0 then
begin
Result := 0;
exit;
end else begin
GetMem(FVersionInfo, FVersionInfoSize);
GetFileVersionInfo(TempFileName, Dummy, FVersionInfoSize, FVersionInfo);
VerQueryValue(FVersionInfo, '\', pointer(FixedInfoData), QueryLen);
Result := LoWord(FixedInfoData^.dwFileVersionLS);
end;
end;
procedure TAboutBox.FormCreate(Sender: TObject);
begin
Caption := Format('About %s', [APPNAME]);
ProgramIcon.Picture.Assign(Application.Icon);
ProgramName.Caption := APPNAME;
VersionCAP.Caption := 'Build ' + inttostr(GetFileBuildNo);
end;
procedure TAboutBox.FormShow(Sender: TObject);
begin
ActiveControl := OkBtn;
end;
end.