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