forked from mashakos/OmniScaler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
OmniScalerSystem.h
99 lines (79 loc) · 2.35 KB
/
OmniScalerSystem.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
////////////////////////////////////////////////////////////////////////////////
// Filename: OmniScalerSystem.h
////////////////////////////////////////////////////////////////////////////////
#ifndef _SYSTEMCLASS_H_
#define _SYSTEMCLASS_H_
#include "stdafx.h"
//////////////
// INCLUDES //
//////////////
#include <afxwin.h>
#include <varargs.h>
#include <iostream>
#include <DWMapi.h>
#include <Tlhelp32.h>
#include <dinput.h>
#include <math.h>
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/ini_parser.hpp>
#include <boost/filesystem.hpp>
#include <comdef.h> // for game launcher code
///////////////////////
// MY CLASS INCLUDES //
///////////////////////
#include "CommandParse.h"
#include "OmniScalerGraphics.h"
#include "OmniScalerD3D.h"
#include "OmniScalerInput.h"
using std::string;
using std::pair;
using namespace boost;
using namespace property_tree;
////////////////////////////////////////////////////////////////////////////////
// Class name: OmniScalerSystem
////////////////////////////////////////////////////////////////////////////////
class OmniScalerSystem :public CWinApp
{
public:
OmniScalerSystem();
OmniScalerSystem(const OmniScalerSystem&);
~OmniScalerSystem();
//Exe Arguments Parse: Fill the passed in array structures.
void GetCommandLineParser(
CStringArray& params,
CStringArray& switches);
HWND find_main_window(unsigned long process_id);
struct handle_data {
unsigned long process_id;
HWND window_handle;
} data;
MSG Msg;
bool InitScaler(HINSTANCE&, int&, LPWSTR&, wchar_t*);
void Shutdown();
void MainLoop();
void InitWindow(HINSTANCE, HWND&, HWND);
LRESULT CALLBACK MessageHandler(HWND, UINT, WPARAM, LPARAM);
HINSTANCE m_hinstance;
void getMouseCursorBitmap(int*);
private:
bool UpdateScreen();
void ShutdownWindow();
private:
HWND FindTargetWindow(unsigned long process_id);
static BOOL CALLBACK static_enum_windows_callback(HWND handle, LPARAM lParam);
CCommandParse m_cmdParse;
LPCWSTR m_applicationName;
HWND* m_hwnd;
OmniScalerInput* m_Input;
OmniScalerGraphics* m_Graphics;
};
/////////////////////////
// FUNCTION PROTOTYPES //
/////////////////////////
static LRESULT CALLBACK oscWndProc(HWND, UINT, WPARAM, LPARAM);
static LRESULT CALLBACK LowLevelKeyboardProc(int, WPARAM, LPARAM);
/////////////
// GLOBALS //
/////////////
static OmniScalerSystem* ApplicationHandle = 0;
#endif