Mercurial > mm7
annotate OSAPI.cpp @ 2311:9dbfeda280d7
Merge
author | Grumpy7 |
---|---|
date | Mon, 17 Mar 2014 22:53:24 +0100 |
parents | aff7a7b072b7 |
children | e7a551f458e1 |
rev | line source |
---|---|
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
|
1 #define _CRT_SECURE_NO_WARNINGS |
0 | 2 #include "OSAPI.h" |
3 #include "OSInfo.h" | |
4 #include "Log.h" | |
5 | |
6 | |
2152 | 7 bool OSInfo::initialized = false; |
8 OSVERSIONINFOA OSInfo::info; | |
0 | 9 |
10 | |
1926 | 11 |
1038 | 12 |
0 | 13 //----- (00462C94) -------------------------------------------------------- |
14 int __stdcall wWinMain(HINSTANCE hInstance, HINSTANCE, wchar_t *lpCmdLine, int nShowCmd) | |
15 { | |
16 Log::Initialize(); | |
17 | |
18 //if (HWND hMM7Window = FindWindowW(L"MM7", 0)) | |
19 if (HWND hMM7Window = FindWindowW(L"M&MTrilogy", 0)) | |
20 { | |
21 if (IsIconic(hMM7Window)) | |
22 ShowWindow(hMM7Window, SW_RESTORE); | |
23 SetForegroundWindow(GetLastActivePopup(hMM7Window)); | |
24 return 0; | |
25 } | |
2152 | 26 |
0 | 27 HWND hPrevWindow = GetActiveWindow(); |
28 { | |
29 Log::Warning(L"OS init: ok"); | |
30 extern bool MM_Main(const wchar_t *pCmdLine); | |
31 MM_Main(lpCmdLine); | |
32 } | |
33 if (hPrevWindow) | |
34 SetActiveWindow(hPrevWindow); | |
35 | |
2152 | 36 return GetLastError(); |
0 | 37 } |
1545 | 38 |
39 | |
40 | |
41 | |
42 void MsgBox(const wchar_t *msg, const wchar_t *title) | |
43 { | |
44 MessageBoxW(nullptr, msg, title, 0); | |
45 } |