annotate OSAPI.cpp @ 2184:e0863f5beee0

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