Mercurial > mm7
annotate OSAPI.cpp @ 2553:48708da03b7f
Party Creation UI logic separated from MainMenu
author | a.parshin |
---|---|
date | Wed, 13 May 2015 02:20:05 +0200 |
parents | 68cdef6879a0 |
children | d87bfbd3bb3b |
rev | line source |
---|---|
2415 | 1 #define _CRTDBG_MAP_ALLOC |
2 #include <stdlib.h> | |
3 #include <crtdbg.h> | |
4 | |
2253
aff7a7b072b7
adding _CRT_SECURE_NO_WARNINGS to get rid of a few hundrer annoying warnings + adding count parameter to swprintf
Grumpy7
parents:
2152
diff
changeset
|
5 #define _CRT_SECURE_NO_WARNINGS |
0 | 6 #include "OSAPI.h" |
7 #include "OSInfo.h" | |
2499 | 8 #include "Engine/Log.h" |
0 | 9 |
10 | |
2152 | 11 bool OSInfo::initialized = false; |
12 OSVERSIONINFOA OSInfo::info; | |
0 | 13 |
14 | |
1926 | 15 |
1038 | 16 |
0 | 17 //----- (00462C94) -------------------------------------------------------- |
2461 | 18 int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hprevinstance, wchar_t *lpCmdLine, int nShowCmd) |
0 | 19 { |
20 Log::Initialize(); | |
21 | |
22 //if (HWND hMM7Window = FindWindowW(L"MM7", 0)) | |
2461 | 23 if (HWND hMM7Window = FindWindowW(L"M&MTrilogy", 0))//check whether the window is open |
0 | 24 { |
25 if (IsIconic(hMM7Window)) | |
26 ShowWindow(hMM7Window, SW_RESTORE); | |
27 SetForegroundWindow(GetLastActivePopup(hMM7Window)); | |
28 return 0; | |
29 } | |
2461 | 30 |
0 | 31 HWND hPrevWindow = GetActiveWindow(); |
2412 | 32 if (!hPrevWindow) |
0 | 33 { |
34 Log::Warning(L"OS init: ok"); | |
35 extern bool MM_Main(const wchar_t *pCmdLine); | |
36 MM_Main(lpCmdLine); | |
37 } | |
38 if (hPrevWindow) | |
39 SetActiveWindow(hPrevWindow); | |
40 | |
2152 | 41 return GetLastError(); |
0 | 42 } |
1545 | 43 |
44 | |
45 | |
46 | |
47 void MsgBox(const wchar_t *msg, const wchar_t *title) | |
48 { | |
49 MessageBoxW(nullptr, msg, title, 0); | |
50 } |