-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Splash.pas
85 lines (69 loc) · 1.94 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
unit Splash;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, jpeg, MMSystem, Registry;
type
TFormSplash = class(TForm)
TimerClose: TTimer;
BG: TImage;
LabelCalculusEx: TLabel;
LabelLoading: TLabel;
procedure TimerCloseTimer(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure FormKeyPress(Sender: TObject; var Key: Char);
procedure FormCreate(Sender: TObject);
private
public
end;
var
FormSplash: TFormSplash;
CFG_SOUND: Integer;
implementation
{$R *.dfm}
{$R resources.RES}
{$SetPEFlags IMAGE_FILE_RELOCS_STRIPPED}
{$SetPEFlags IMAGE_FILE_LINE_NUMS_STRIPPED}
{$SetPEFlags IMAGE_FILE_LOCAL_SYMS_STRIPPED}
{$SetPEFlags IMAGE_FILE_DEBUG_STRIPPED}
{$SetPEFlags IMAGE_FILE_EXECUTABLE_IMAGE}
uses Main;
procedure TFormSplash.FormCreate(Sender: TObject);
var
PCReg: TRegistry;
begin
PCReg:=TRegistry.Create;
try
PCReg.RootKey:=HKEY_LOCAL_MACHINE;
PCReg.OpenKey('SOFTWARE\NeoVisio\CalculusEx', False);
CFG_SOUND:=PCReg.ReadInteger('Sound');
PCReg.CloseKey;
finally
PCReg.Free;
end;
end;
procedure TFormSplash.FormKeyPress(Sender: TObject; var Key: Char);
begin
If (Key=#27) Then Application.MainForm.Close;
end;
procedure TFormSplash.FormShow(Sender: TObject);
var
Ellipse: HRGN;
begin
Ellipse:=CreateRoundRectRgn(0, 0, ClientWidth,ClientHeight, 20, 20);
SetWindowRgn(Handle, Ellipse, True);
If (CFG_SOUND=1) Then
sndPlaySound('audio', SND_ASYNC Or SND_RESOURCE);
Left:=(Screen.WorkAreaWidth-Width) Div 2;
Top:=(Screen.WorkAreaHeight-Height) Div 2;
AnimateWindow(FormSplash.Handle, 500, AW_BLEND);
If (Length(ParamStr(1))>1) And (FileExists(ParamStr(1))) Then
Main.FormMain.OpenExFile(ParamStr(1));
end;
procedure TFormSplash.TimerCloseTimer(Sender: TObject);
begin
TimerClose.Enabled:=False;
Main.FormMain.Show;
Close;
end;
end.