-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CalculusEx.dpr
109 lines (95 loc) · 3.15 KB
/
CalculusEx.dpr
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
97
98
99
100
101
102
103
104
105
106
107
108
109
program CalculusEx;
{$R *.dres}
uses
Vcl.Forms,
Winapi.Windows,
System.Win.Registry,
Winapi.ShlObj,
Vcl.Themes,
Vcl.Styles,
Vcl.Graphics,
Vcl.Dialogs,
System.UITypes,
Main in 'Main.pas' {FormMain},
Splash in 'Splash.pas' {FormSplash},
Settings in 'Settings.pas',
Results in 'Results.pas' {FormResults},
Lists in 'Lists.pas' {FormList},
PositionList in 'PositionList.pas' {FormPosition},
About in 'About.pas' {FormAbout},
Find in 'Find.pas' {FindDialog};
{FormSettings}
{$R *.res}
var
RegistryObj: TRegistry;
begin
ReportMemoryLeaksOnShutdown:=True;
Application.Initialize;
Application.MainFormOnTaskbar:=True;
TStyleManager.TrySetStyle('Cobalt XEMedia');
Application.Title:='CalculusEx';
If (ParamStr(1)='-setup') Then
begin
RegistryObj:=TRegistry.Create;
try
RegistryObj.RootKey:=HKEY_CLASSES_ROOT;
RegistryObj.OpenKey('.cxf', True);
RegistryObj.WriteString('', 'CalculusEx.File');
RegistryObj.CloseKey;
RegistryObj.OpenKey('CalculusEx.File', True);
RegistryObj.OpenKey('DefaultIcon', True);
RegistryObj.WriteString('', '"'+ParamStr(0)+'",1');
RegistryObj.CloseKey;
RegistryObj.OpenKey('CalculusEx.File', True);
RegistryObj.WriteString('', 'CalculusEx File');
RegistryObj.OpenKey('shell', True);
RegistryObj.OpenKey('open', True);
RegistryObj.OpenKey('command', True);
RegistryObj.WriteString('', '"'+ParamStr(0)+'" "%1"');
RegistryObj.CloseKey;
RegistryObj.RootKey:=HKEY_LOCAL_MACHINE;
RegistryObj.OpenKey('SOFTWARE', False);
RegistryObj.OpenKey('NeoVisio', True);
RegistryObj.OpenKey('CalculusEx', True);
RegistryObj.WriteString('BgColor', '$00EE5346');
RegistryObj.WriteString('TextColor', ColorToString(clWhite));
RegistryObj.WriteString('FontName', 'Arial');
RegistryObj.WriteInteger('FontSize', 9);
RegistryObj.WriteInteger('Sound', 1);
RegistryObj.WriteInteger('FormatNum', 2);
RegistryObj.WriteInteger('FillFrom', 0);
RegistryObj.WriteInteger('FillTo', 1000);
RegistryObj.CloseKey;
SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, Nil, Nil);
finally
RegistryObj.Free;
Application.Terminate;
end;
end
Else
begin
Application.CreateForm(TFormMain, FormMain);
Application.CreateForm(TFormAbout, FormAbout);
Application.CreateForm(TFindDialog, FindDialog);
If ParamStr(1)<>'-gui' Then
FormMain.Hide
Else
ShowWindow(Application.MainFormHandle, SW_SHOWNORMAL);
If (ParamStr(1)<>'-gui') Or (ParamStr(1)='') Then
begin
Application.CreateForm(TFormSplash, FormSplash);
FormSplash.ShowModal;
FormSplash.Free;
end;
If ParamStr(1)='-reset' Then
begin
MessageBeep(MB_ICONINFORMATION);
MessageDlg('Podešavanja aplikacije su uspešno vraćena na podrazumevana.', mtInformation, [mbOK], 0, mbOK);
end;
Application.CreateForm(TFormList, FormList);
Application.CreateForm(TFormPosition, FormPosition);
Application.CreateForm(TFormSettings, FormSettings);
Application.CreateForm(TFormResults, FormResults);
Application.Run;
end;
end.