0
|
1 #include "OSAPI.h"
|
|
2 #include "OSInfo.h"
|
|
3 #include "Log.h"
|
|
4
|
|
5
|
|
6 OSVersion *pVersion = nullptr;
|
|
7
|
|
8
|
1038
|
9
|
0
|
10 //----- (00462C94) --------------------------------------------------------
|
|
11 int __stdcall wWinMain(HINSTANCE hInstance, HINSTANCE, wchar_t *lpCmdLine, int nShowCmd)
|
|
12 {
|
|
13 Log::Initialize();
|
|
14
|
|
15 //if (HWND hMM7Window = FindWindowW(L"MM7", 0))
|
|
16 if (HWND hMM7Window = FindWindowW(L"M&MTrilogy", 0))
|
|
17 {
|
|
18 if (IsIconic(hMM7Window))
|
|
19 ShowWindow(hMM7Window, SW_RESTORE);
|
|
20 SetForegroundWindow(GetLastActivePopup(hMM7Window));
|
|
21 return 0;
|
|
22 }
|
|
23 HWND hPrevWindow = GetActiveWindow();
|
|
24
|
|
25 pVersion = new OSVersion;
|
|
26 {
|
|
27 Log::Warning(L"OS init: ok");
|
|
28
|
|
29 extern bool MM_Main(const wchar_t *pCmdLine);
|
|
30 MM_Main(lpCmdLine);
|
|
31 }
|
|
32 delete pVersion;
|
|
33 pVersion = nullptr;
|
|
34
|
|
35 SetPriorityClass(GetCurrentProcess(), NORMAL_PRIORITY_CLASS);
|
|
36 if (hPrevWindow)
|
|
37 SetActiveWindow(hPrevWindow);
|
|
38
|
28
|
39 //__debugbreak();
|
0
|
40 return 0;
|
|
41 }
|
1545
|
42
|
|
43
|
|
44
|
|
45
|
|
46 void MsgBox(const wchar_t *msg, const wchar_t *title)
|
|
47 {
|
|
48 MessageBoxW(nullptr, msg, title, 0);
|
|
49 } |