-
Notifications
You must be signed in to change notification settings - Fork 5
/
StartFromTray.dpr
69 lines (58 loc) · 2.03 KB
/
StartFromTray.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
program StartFromTray;
uses
Forms,
CommandsClass_U in 'CommandsClass_U.pas',
CommonU in 'CommonU.pas',
frmConfig_U in 'frmConfig_U.pas' {frmConfig},
FilterClass_U in 'FilterClass_U.pas',
frmExtensions_U in 'frmExtensions_U.pas' {frmExtensions},
frmCommandConfig_U in 'frmCommandConfig_U.pas' {frmCommandConfig: TFrame},
Vcl.Themes,
Vcl.Styles,
System.SysUtils,
System.IniFiles,
WinAPI.Windows,
LangsU in 'LangsU.pas',
MPPopupMenu in 'MPPopupMenu.pas',
frmChooseExt_U in 'frmChooseExt_U.pas' {frmChooseExt};
{$R *.res}
var MainIniFile: TIniFile;
begin
Application.Initialize;
Application.CreateForm(TfrmConfig, frmConfig);
Application.CreateForm(TfrmExtensions, frmExtensions);
Application.CreateForm(TfrmChooseExt, frmChooseExt);
Application.ShowMainForm := False;
GenDefaultFileLang;
MainIniFile := TIniFile.Create(ChangeFileExt(ParamStr(0), '.ini'));
frmConfig.MainIniFile := MainIniFile;
with frmConfig do
begin
var LangIndex := LangFillListAndGetCurrent(MainIniFile,
ppOptionsMenu, miOptionsLang, miOptionsLangClick);
if LangIndex <> 0 then
miOptionsLangClick(miOptionsLang.Items[LangIndex]);
{miOptionsLangClick(miOptionsLang.Items[LangFillListAndGetCurrent(MainIniFile,
ppOptionsMenu, miOptionsLang, miOptionsLangClick)]);}
if Assigned(MainIniFile) then
with MainIniFile do
begin
WindowState := TWindowState(ReadInteger(cIniFormIdent, cIniFormState, Integer(WindowState)));
Width := ReadInteger(cIniFormIdent, cIniFormWidth, Width);
Height := ReadInteger(cIniFormIdent, cIniFormHeight, Height);
end;
end;
if frmConfig.tvItems.Items.Count <= 0 then
frmConfig.Show;
with MainIniFile do
begin
if ReadBool('Main', 'ConfigShow', False) then
frmConfig.Show;
//ShowWindow(frmConfig.Handle, SW_Restore);
if ReadBool('Main', 'FiltersShow', False) then
frmExtensions.ShowModal;
end;
// it has to be before Run, after all initialization
frmConfig.TrayIcon.Visible := True;
Application.Run;
end.