annotate OSAPI.cpp @ 1644:dbd6f940f26c

Fixed Celestia sky a bit.
author Nomad
date Tue, 17 Sep 2013 21:41:39 +0200
parents c4ab816fcc5e
children 633f81bb3ae7
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
Ritor1
parents:
diff changeset
6 OSVersion *pVersion = nullptr;
Ritor1
parents:
diff changeset
7
Ritor1
parents:
diff changeset
8
1038
39f42990698f Cleanings
Nomad
parents: 28
diff changeset
9
0
Ritor1
parents:
diff changeset
10 //----- (00462C94) --------------------------------------------------------
Ritor1
parents:
diff changeset
11 int __stdcall wWinMain(HINSTANCE hInstance, HINSTANCE, wchar_t *lpCmdLine, int nShowCmd)
Ritor1
parents:
diff changeset
12 {
Ritor1
parents:
diff changeset
13 Log::Initialize();
Ritor1
parents:
diff changeset
14
Ritor1
parents:
diff changeset
15 //if (HWND hMM7Window = FindWindowW(L"MM7", 0))
Ritor1
parents:
diff changeset
16 if (HWND hMM7Window = FindWindowW(L"M&MTrilogy", 0))
Ritor1
parents:
diff changeset
17 {
Ritor1
parents:
diff changeset
18 if (IsIconic(hMM7Window))
Ritor1
parents:
diff changeset
19 ShowWindow(hMM7Window, SW_RESTORE);
Ritor1
parents:
diff changeset
20 SetForegroundWindow(GetLastActivePopup(hMM7Window));
Ritor1
parents:
diff changeset
21 return 0;
Ritor1
parents:
diff changeset
22 }
Ritor1
parents:
diff changeset
23 HWND hPrevWindow = GetActiveWindow();
Ritor1
parents:
diff changeset
24
Ritor1
parents:
diff changeset
25 pVersion = new OSVersion;
Ritor1
parents:
diff changeset
26 {
Ritor1
parents:
diff changeset
27 Log::Warning(L"OS init: ok");
Ritor1
parents:
diff changeset
28
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 delete pVersion;
Ritor1
parents:
diff changeset
33 pVersion = nullptr;
Ritor1
parents:
diff changeset
34
Ritor1
parents:
diff changeset
35 SetPriorityClass(GetCurrentProcess(), NORMAL_PRIORITY_CLASS);
Ritor1
parents:
diff changeset
36 if (hPrevWindow)
Ritor1
parents:
diff changeset
37 SetActiveWindow(hPrevWindow);
Ritor1
parents:
diff changeset
38
28
739d8f3b50f9 ReleaseSoundData fix
zipi@zipi-PC
parents: 0
diff changeset
39 //__debugbreak();
0
Ritor1
parents:
diff changeset
40 return 0;
Ritor1
parents:
diff changeset
41 }
1545
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1038
diff changeset
42
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 void MsgBox(const wchar_t *msg, const wchar_t *title)
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1038
diff changeset
47 {
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1038
diff changeset
48 MessageBoxW(nullptr, msg, title, 0);
c4ab816fcc5e assert, Abortf, AbortWithError -> Assert, Error
Nomad
parents: 1038
diff changeset
49 }