annotate OSAPI.cpp @ 2403:069018761f96

Слияние
author Ritor1
date Mon, 14 Jul 2014 10:04:14 +0600
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
Ritor1
parents:
diff changeset
2 #include "OSAPI.h"
Ritor1
parents:
diff changeset
3 #include "OSInfo.h"
Ritor1
parents:
diff changeset
4 #include "Log.h"
Ritor1
parents:
diff changeset
5
Ritor1
parents:
diff changeset
6
2152
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 2059
diff changeset
7 bool OSInfo::initialized = false;
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 2059
diff changeset
8 OSVERSIONINFOA OSInfo::info;
0
Ritor1
parents:
diff changeset
9
Ritor1
parents:
diff changeset
10
1926
3eb0c4f3d899 Woops, debug stuff.
Nomad
parents: 1924
diff changeset
11
1038
39f42990698f Cleanings
Nomad
parents: 28
diff changeset
12
0
Ritor1
parents:
diff changeset
13 //----- (00462C94) --------------------------------------------------------
Ritor1
parents:
diff changeset
14 int __stdcall wWinMain(HINSTANCE hInstance, HINSTANCE, wchar_t *lpCmdLine, int nShowCmd)
Ritor1
parents:
diff changeset
15 {
Ritor1
parents:
diff changeset
16 Log::Initialize();
Ritor1
parents:
diff changeset
17
Ritor1
parents:
diff changeset
18 //if (HWND hMM7Window = FindWindowW(L"MM7", 0))
Ritor1
parents:
diff changeset
19 if (HWND hMM7Window = FindWindowW(L"M&MTrilogy", 0))
Ritor1
parents:
diff changeset
20 {
Ritor1
parents:
diff changeset
21 if (IsIconic(hMM7Window))
Ritor1
parents:
diff changeset
22 ShowWindow(hMM7Window, SW_RESTORE);
Ritor1
parents:
diff changeset
23 SetForegroundWindow(GetLastActivePopup(hMM7Window));
Ritor1
parents:
diff changeset
24 return 0;
Ritor1
parents:
diff changeset
25 }
2152
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 2059
diff changeset
26
0
Ritor1
parents:
diff changeset
27 HWND hPrevWindow = GetActiveWindow();
Ritor1
parents:
diff changeset
28 {
Ritor1
parents:
diff changeset
29 Log::Warning(L"OS init: ok");
Ritor1
parents:
diff changeset
30 extern bool MM_Main(const wchar_t *pCmdLine);
Ritor1
parents:
diff changeset
31 MM_Main(lpCmdLine);
Ritor1
parents:
diff changeset
32 }
Ritor1
parents:
diff changeset
33 if (hPrevWindow)
Ritor1
parents:
diff changeset
34 SetActiveWindow(hPrevWindow);
Ritor1
parents:
diff changeset
35
2152
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 2059
diff changeset
36 return GetLastError();
0
Ritor1
parents:
diff changeset
37 }
1545
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1038
diff changeset
38
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1038
diff changeset
39
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1038
diff changeset
40
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1038
diff changeset
41
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1038
diff changeset
42 void MsgBox(const wchar_t *msg, const wchar_t *title)
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1038
diff changeset
43 {
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1038
diff changeset
44 MessageBoxW(nullptr, msg, title, 0);
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1038
diff changeset
45 }