-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMousePuff.cpp
50 lines (47 loc) · 1.28 KB
/
MousePuff.cpp
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
// ---------------------------------------------------------------------------
#include <vcl.h>
#include <tchar.h>
#include <Registry.hpp>
#pragma hdrstop
// ---------------------------------------------------------------------------
USEFORM("Main.cpp", FormMousePuff1);
//---------------------------------------------------------------------------
int WINAPI _tWinMain(HINSTANCE, HINSTANCE, LPTSTR, int)
{
try
{
Application->Initialize();
Application->MainFormOnTaskBar = true;
Application->CreateForm(__classid(TFormMousePuff1), &FormMousePuff1);
TIniFile *ini = new TIniFile(ChangeFileExt(Application->ExeName, ".ini"));
Application->ShowMainForm = ini->ReadInteger(L"MAIN", L"StartToTray", 0) == 0;
delete ini;
// read command line (overrides config)
for (int i = 1; i <= ParamCount(); i++)
{
if (LowerCase(ParamStr(i)) == "-tray")
{
Application->ShowMainForm = false;
break;
}
}
Application->Run();
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
catch (...)
{
try
{
throw Exception("");
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
}
return 0;
}
// ---------------------------------------------------------------------------