annotate OSAPI.cpp @ 94:6c42178c226e

minor things
author Nomad
date Fri, 02 Nov 2012 14:42:09 +0200
parents fde5c5acb66e
children 918dca162239
rev   line source
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1 #include "OSAPI.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2 #include "OSInfo.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3 #include "Log.h"
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6 OSVersion *pVersion = nullptr;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8 //----- (00462C94) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9 int __stdcall wWinMain(HINSTANCE hInstance, HINSTANCE, wchar_t *lpCmdLine, int nShowCmd)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11 Log::Initialize();
50
fde5c5acb66e BLV render
Nomad
parents: 23
diff changeset
12
fde5c5acb66e BLV render
Nomad
parents: 23
diff changeset
13 //if (HWND hMM7Window = FindWindowW(L"MM7", 0))
fde5c5acb66e BLV render
Nomad
parents: 23
diff changeset
14 if (HWND hMM7Window = FindWindowW(L"M&MTrilogy", 0))
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16 if (IsIconic(hMM7Window))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17 ShowWindow(hMM7Window, SW_RESTORE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18 SetForegroundWindow(GetLastActivePopup(hMM7Window));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21 HWND hPrevWindow = GetActiveWindow();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
23 pVersion = new OSVersion;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
24 {
23
509744251c8e Player-related members
Nomad
parents: 0
diff changeset
25 Log::Warning(L"OS init: ok");
509744251c8e Player-related members
Nomad
parents: 0
diff changeset
26
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
27 extern bool MM_Main(const wchar_t *pCmdLine);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
28 MM_Main(lpCmdLine);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
29 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
30 delete pVersion;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
31 pVersion = nullptr;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
32
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
33 SetPriorityClass(GetCurrentProcess(), NORMAL_PRIORITY_CLASS);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
34 if (hPrevWindow)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
35 SetActiveWindow(hPrevWindow);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
36
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
37 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
38 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
39 }