annotate OSAPI.cpp @ 1:ac0fb48cd27a

Texture, hwl loading, video player
author Nomad
date Tue, 09 Oct 2012 13:09:08 +0200
parents 8b8875f5b359
children 509744251c8e
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 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
24 extern bool MM_Main(const wchar_t *pCmdLine);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
25 MM_Main(lpCmdLine);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
26 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
27 delete pVersion;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
28 pVersion = nullptr;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
29
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
30 SetPriorityClass(GetCurrentProcess(), NORMAL_PRIORITY_CLASS);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
31 if (hPrevWindow)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
32 SetActiveWindow(hPrevWindow);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
33
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
34 __debugbreak();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
35 return 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
36 }