forked from asousa-feup/FEUPAutom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsplash.pas
96 lines (77 loc) · 2.4 KB
/
splash.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
93
94
95
96
unit splash;
{$MODE Delphi}
interface
uses
{$IFDEF Windows}
Windows,
{$ENDIF}
Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, Win32Proc
//,lazjpg
;
type
{ TFormSplash }
TFormSplash = class(TForm)
Image1: TImage;
Label3: TLabel;
Label4: TLabel;
LabelVersionString: TLabel;
LabelWinVerString: TLabel;
Panel_Splash: TPanel;
procedure FormClick(Sender: TObject);
procedure MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure FormCreate(Sender: TObject);
procedure FormKeyPress(Sender: TObject; var Key: Char);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FormSplash: TFormSplash;
implementation
{$R *.lfm}
uses main;
procedure TFormSplash.FormClick(Sender: TObject);
begin
FormSplash.Close;
end;
procedure TFormSplash.MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
FormSplash.Close;
end;
// https://wiki.lazarus.freepascal.org/WindowsVersion
Function GetWinVer : string;
Begin
if WindowsVersion = wv95 then Result := 'Windows 95'
else if WindowsVersion = wvNT4 then Result := 'Windows NT v.4'
else if WindowsVersion = wv98 then Result := 'Windows 98'
else if WindowsVersion = wvMe then Result := 'Windows ME'
else if WindowsVersion = wv2000 then Result := 'Windows 2000'
else if WindowsVersion = wvXP then Result := 'Windows XP'
else if WindowsVersion = wvServer2003 then Result := 'Windows Server 2003/Windows XP64'
else if WindowsVersion = wvVista then Result := 'Windows Vista'
else if WindowsVersion = wv7 then Result := 'Windows 7'
else if WindowsVersion = wv10 then Result := 'Windows 10'
else Result := 'Windows Unknown Version!';
End;
//https://forum.lazarus.freepascal.org/index.php?topic=43030.0
procedure TFormSplash.FormCreate(Sender: TObject);
begin
LabelVersionString.Caption:=VersionString+DateToStr(FileDateToDateTime(FileAge(Application.ExeName) ));
LabelWinVerString.Caption :=
{$ifdef mswindows}
'Windows'
{$else}
{$i %FPCTargetOS%}
{$endif}
+ Format(' %d-bit', [SizeOf(Pointer) * 8]);
LabelWinVerString.Caption := 'Executable '+LabelWinVerString.Caption+' - ' +GetWinVer();
end;
procedure TFormSplash.FormKeyPress(Sender: TObject; var Key: Char);
begin
FormSplash.Close;
end;
end.