annotate OSAPI.cpp @ 2480:24fd08aef81e

Слияние
author Ritor1
date Fri, 22 Aug 2014 11:07:07 +0600
parents ff7f4995aa25
children 68cdef6879a0
rev   line source
2415
f4af3b203f65 LOD.cpp cleaned and search memory corrupt
Ritor1
parents: 2412
diff changeset
1 #define _CRTDBG_MAP_ALLOC
f4af3b203f65 LOD.cpp cleaned and search memory corrupt
Ritor1
parents: 2412
diff changeset
2 #include <stdlib.h>
f4af3b203f65 LOD.cpp cleaned and search memory corrupt
Ritor1
parents: 2412
diff changeset
3 #include <crtdbg.h>
f4af3b203f65 LOD.cpp cleaned and search memory corrupt
Ritor1
parents: 2412
diff changeset
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
Ritor1
parents:
diff changeset
6 #include "OSAPI.h"
Ritor1
parents:
diff changeset
7 #include "OSInfo.h"
Ritor1
parents:
diff changeset
8 #include "Log.h"
Ritor1
parents:
diff changeset
9
Ritor1
parents:
diff changeset
10
2152
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 2059
diff changeset
11 bool OSInfo::initialized = false;
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 2059
diff changeset
12 OSVERSIONINFOA OSInfo::info;
0
Ritor1
parents:
diff changeset
13
Ritor1
parents:
diff changeset
14
1926
3eb0c4f3d899 Woops, debug stuff.
Nomad
parents: 1924
diff changeset
15
1038
39f42990698f Cleanings
Nomad
parents: 28
diff changeset
16
0
Ritor1
parents:
diff changeset
17 //----- (00462C94) --------------------------------------------------------
2461
ff7f4995aa25 function MakeScreenshot()
Ritor1
parents: 2415
diff changeset
18 int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hprevinstance, wchar_t *lpCmdLine, int nShowCmd)
0
Ritor1
parents:
diff changeset
19 {
Ritor1
parents:
diff changeset
20 Log::Initialize();
Ritor1
parents:
diff changeset
21
Ritor1
parents:
diff changeset
22 //if (HWND hMM7Window = FindWindowW(L"MM7", 0))
2461
ff7f4995aa25 function MakeScreenshot()
Ritor1
parents: 2415
diff changeset
23 if (HWND hMM7Window = FindWindowW(L"M&MTrilogy", 0))//check whether the window is open
0
Ritor1
parents:
diff changeset
24 {
Ritor1
parents:
diff changeset
25 if (IsIconic(hMM7Window))
Ritor1
parents:
diff changeset
26 ShowWindow(hMM7Window, SW_RESTORE);
Ritor1
parents:
diff changeset
27 SetForegroundWindow(GetLastActivePopup(hMM7Window));
Ritor1
parents:
diff changeset
28 return 0;
Ritor1
parents:
diff changeset
29 }
2461
ff7f4995aa25 function MakeScreenshot()
Ritor1
parents: 2415
diff changeset
30
0
Ritor1
parents:
diff changeset
31 HWND hPrevWindow = GetActiveWindow();
2412
e7a551f458e1 LoadSound - cause of the crash exe file
Ritor1
parents: 2253
diff changeset
32 if (!hPrevWindow)
0
Ritor1
parents:
diff changeset
33 {
Ritor1
parents:
diff changeset
34 Log::Warning(L"OS init: ok");
Ritor1
parents:
diff changeset
35 extern bool MM_Main(const wchar_t *pCmdLine);
Ritor1
parents:
diff changeset
36 MM_Main(lpCmdLine);
Ritor1
parents:
diff changeset
37 }
Ritor1
parents:
diff changeset
38 if (hPrevWindow)
Ritor1
parents:
diff changeset
39 SetActiveWindow(hPrevWindow);
Ritor1
parents:
diff changeset
40
2152
d44b7775fc06 Removed DirectDraw2 compatibility.
Nomad
parents: 2059
diff changeset
41 return GetLastError();
0
Ritor1
parents:
diff changeset
42 }
1545
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1038
diff changeset
43
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1038
diff changeset
44
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1038
diff changeset
45
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1038
diff changeset
46
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1038
diff changeset
47 void MsgBox(const wchar_t *msg, const wchar_t *title)
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1038
diff changeset
48 {
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1038
diff changeset
49 MessageBoxW(nullptr, msg, title, 0);
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1038
diff changeset
50 }