annotate OSAPI.cpp @ 170:f089d88b6739

PopupWindow(work)
author Ritor1
date Thu, 13 Dec 2012 17:22:39 +0600
parents 918dca162239
children
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
116
918dca162239 stru170 -> BspRenderer
Nomad
parents: 50
diff changeset
8
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9 //----- (00462C94) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10 int __stdcall wWinMain(HINSTANCE hInstance, HINSTANCE, wchar_t *lpCmdLine, int nShowCmd)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12 Log::Initialize();
50
fde5c5acb66e BLV render
Nomad
parents: 23
diff changeset
13
fde5c5acb66e BLV render
Nomad
parents: 23
diff changeset
14 //if (HWND hMM7Window = FindWindowW(L"MM7", 0))
fde5c5acb66e BLV render
Nomad
parents: 23
diff changeset
15 if (HWND hMM7Window = FindWindowW(L"M&MTrilogy", 0))
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17 if (IsIconic(hMM7Window))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18 ShowWindow(hMM7Window, SW_RESTORE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19 SetForegroundWindow(GetLastActivePopup(hMM7Window));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22 HWND hPrevWindow = GetActiveWindow();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
24 pVersion = new OSVersion;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
25 {
23
509744251c8e Player-related members
Nomad
parents: 0
diff changeset
26 Log::Warning(L"OS init: ok");
509744251c8e Player-related members
Nomad
parents: 0
diff changeset
27
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
28 extern bool MM_Main(const wchar_t *pCmdLine);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
29 MM_Main(lpCmdLine);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
30 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
31 delete pVersion;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
32 pVersion = nullptr;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
34 SetPriorityClass(GetCurrentProcess(), NORMAL_PRIORITY_CLASS);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
35 if (hPrevWindow)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
36 SetActiveWindow(hPrevWindow);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
37
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
38 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
39 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
40 }