annotate OSAPI.cpp @ 40:001b45e84aaa

Слияние
author Ritor1
date Thu, 18 Oct 2012 09:12:15 +0600
parents 509744251c8e
children fde5c5acb66e
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();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13 if (HWND hMM7Window = FindWindowW(L"MM7", 0))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15 if (IsIconic(hMM7Window))
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16 ShowWindow(hMM7Window, SW_RESTORE);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17 SetForegroundWindow(GetLastActivePopup(hMM7Window));
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20 HWND hPrevWindow = GetActiveWindow();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22 pVersion = new OSVersion;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
23 {
23
509744251c8e Player-related members
Nomad
parents: 0
diff changeset
24 Log::Warning(L"OS init: ok");
509744251c8e Player-related members
Nomad
parents: 0
diff changeset
25
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
26 extern bool MM_Main(const wchar_t *pCmdLine);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
27 MM_Main(lpCmdLine);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
28 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
29 delete pVersion;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
30 pVersion = nullptr;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
31
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
32 SetPriorityClass(GetCurrentProcess(), NORMAL_PRIORITY_CLASS);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
33 if (hPrevWindow)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
34 SetActiveWindow(hPrevWindow);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
35
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
36 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
37 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
38 }