Mercurial > mm7
annotate OSAPI.cpp @ 2572:d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
author | a.parshin |
---|---|
date | Sat, 05 Mar 2016 01:51:54 +0200 |
parents | 68cdef6879a0 |
children | a76d408c5132 |
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 { |
2572
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2499
diff
changeset
|
20 #ifndef NDEBUG |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2499
diff
changeset
|
21 { |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2499
diff
changeset
|
22 //_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF | _CRTDBG_CHECK_ALWAYS_DF); |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2499
diff
changeset
|
23 } |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2499
diff
changeset
|
24 #endif |
d87bfbd3bb3b
Step towards unification of Texture and RGBTexture (class Image)
a.parshin
parents:
2499
diff
changeset
|
25 |
0 | 26 Log::Initialize(); |
27 | |
28 //if (HWND hMM7Window = FindWindowW(L"MM7", 0)) | |
2461 | 29 if (HWND hMM7Window = FindWindowW(L"M&MTrilogy", 0))//check whether the window is open |
0 | 30 { |
31 if (IsIconic(hMM7Window)) | |
32 ShowWindow(hMM7Window, SW_RESTORE); | |
33 SetForegroundWindow(GetLastActivePopup(hMM7Window)); | |
34 return 0; | |
35 } | |
2461 | 36 |
0 | 37 HWND hPrevWindow = GetActiveWindow(); |
2412 | 38 if (!hPrevWindow) |
0 | 39 { |
40 Log::Warning(L"OS init: ok"); | |
41 extern bool MM_Main(const wchar_t *pCmdLine); | |
42 MM_Main(lpCmdLine); | |
43 } | |
44 if (hPrevWindow) | |
45 SetActiveWindow(hPrevWindow); | |
46 | |
2152 | 47 return GetLastError(); |
0 | 48 } |
1545 | 49 |
50 | |
51 | |
52 | |
53 void MsgBox(const wchar_t *msg, const wchar_t *title) | |
54 { | |
55 MessageBoxW(nullptr, msg, title, 0); | |
56 } |