FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
KReClassEx/KReClassEx/KReClassEx.cpp at master · BeneficialCode/KReClassEx · GitHub
BeneficialCode
/
KReClassEx
Public
Notifications
You must be signed in to change notification settings
Fork
5
Star
67
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
KReClassEx
/
KReClassEx
/
KReClassEx.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
170 lines (131 loc) · 4.41 KB
Breadcrumbs
KReClassEx
/
KReClassEx
/
KReClassEx.cpp
Copy path
File metadata and controls
170 lines (131 loc) · 4.41 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
//
KReClassEx.cpp : main source file for KReClassEx.exe
//
#
include
"
stdafx.h
"
#
include
<
atlribbon.h
>
#
include
"
Ribbon.h
"
#
include
"
resource.h
"
#
include
"
aboutdlg.h
"
#
include
"
MainFrm.h
"
#
pragma
comment(lib, "imm32")
typedef
enum
PROCESS_DPI_AWARENESS
{
PROCESS_DPI_UNAWARE
=
0
,
PROCESS_SYSTEM_DPI_AWARE
=
1
,
PROCESS_PER_MONITOR_DPI_AWARE
=
2
};
typedef
enum
MONITOR_DPI_TYPE
{
MDT_EFFECTIVE_DPI
=
0
,
MDT_ANGULAR_DPI
=
1
,
MDT_RAW_DPI
=
2
,
MDT_DEFAULT
};
using
PGetProcessDpiAwareness =
HRESULT
(
WINAPI
*) (
_In_
HANDLE
hProcess,
_Out_
PROCESS_DPI_AWARENESS
* value
);
using
PGetDpiForMonitor =
HRESULT
(
WINAPI
*)(
_In_
HMONITOR
hMonitor,
_In_
MONITOR_DPI_TYPE
dpiType,
_Out_
UINT
* dpiX,
_Out_
UINT
* dpiY);
CAppModule _Module;
BOOL
InitApp
(
HINSTANCE
hInst);
void
ResizeMemoryFont
(
HWND
hWnd,
int
width,
int
height);
int
Run
(
LPTSTR
/*
lpstrCmdLine
*/
=
NULL
,
int
nCmdShow =
SW_SHOWDEFAULT
)
{
CMessageLoop theLoop;
_Module.
AddMessageLoop
(&theLoop);
CMainFrame wndMain;
HWND
hWnd = wndMain.
CreateEx
();
if
(hWnd ==
NULL
)
{
ATLTRACE
(
_T
(
"
Main window creation failed!
\n
"
));
return
0
;
}
//
//
Fix for 4K monitors
//
ResizeMemoryFont
(hWnd, g_FontWidth, g_FontHeight);
wndMain.
ShowWindow
(nCmdShow);
int
nRet = theLoop.
Run
();
_Module.
RemoveMessageLoop
();
return
nRet;
}
int
WINAPI
_tWinMain
(
HINSTANCE
hInstance,
HINSTANCE
/*
hPrevInstance
*/
,
LPTSTR
lpstrCmdLine,
int
nCmdShow)
{
HRESULT
hRes = ::
CoInitialize
(
NULL
);
ATLASSERT
(
SUCCEEDED
(hRes));
AtlInitCommonControls
(
ICC_BAR_CLASSES
);
//
add flags to support other controls
hRes = _Module.
Init
(
NULL
, hInstance);
ATLASSERT
(
SUCCEEDED
(hRes));
InitApp
(hInstance);
Scintilla_RegisterClasses
(hInstance);
int
nRet =
0
;
if
(
RunTimeHelper::IsRibbonUIAvailable
())
nRet =
Run
(lpstrCmdLine, nCmdShow);
else
AtlMessageBox
(
NULL
,
L"
Cannot run with this version of Windows
"
,
IDR_MAINFRAME
);
_Module.
Term
();
::CoUninitialize
();
Scintilla_ReleaseResources
();
return
nRet;
}
void
ResizeMemoryFont
(
HWND
hWnd,
int
width,
int
height) {
if
(!g_ViewFont.
IsNull
())
g_ViewFont.
DeleteObject
();
HMODULE
hShcoreBase =
GetModuleHandle
(
L"
shcore.dll
"
);
if
(hShcoreBase) {
PGetProcessDpiAwareness pGetProcessDpiAwareness =
reinterpret_cast
<PGetProcessDpiAwareness>(
GetProcAddress
(hShcoreBase,
"
GetProcessDpiAwareness
"
));
PGetDpiForMonitor pGetDpiForMonitor =
reinterpret_cast
<PGetDpiForMonitor>(
GetProcAddress
(hShcoreBase,
"
GetDpiForMonitor
"
));
if
(pGetProcessDpiAwareness && pGetDpiForMonitor) {
PROCESS_DPI_AWARENESS
dpiValue;
UINT
dpiX, dpiY;
HMONITOR
hMonitor;
pGetProcessDpiAwareness
(
nullptr
, &dpiValue);
if
(dpiValue ==
PROCESS_DPI_AWARENESS
::
PROCESS_PER_MONITOR_DPI_AWARE
||
dpiValue ==
PROCESS_DPI_AWARENESS
::
PROCESS_SYSTEM_DPI_AWARE
) {
hMonitor = ::
MonitorFromWindow
(hWnd,
MONITOR_DEFAULTTONEAREST
);
pGetDpiForMonitor
(hMonitor,
MONITOR_DPI_TYPE
::
MDT_EFFECTIVE_DPI
, &dpiX, &dpiY);
g_FontWidth =
MulDiv
(width,
MulDiv
(dpiX,
100
,
96
),
100
);
g_FontHeight =
MulDiv
(height,
MulDiv
(dpiY,
100
,
96
),
100
);
}
}
}
g_ViewFont.
CreateFont
(g_FontHeight, g_FontWidth,
0
,
0
,
FW_NORMAL
,
FALSE
,
FALSE
,
FALSE
,
0
,
OUT_DEFAULT_PRECIS
,
CLIP_DEFAULT_PRECIS
,
CLEARTYPE_QUALITY
,
FIXED_PITCH
, g_ViewFontName);
}
BOOL
InitApp
(
HINSTANCE
hInst) {
g_ViewFontName =
L"
Terminal
"
;
UINT
icons[] = {
IDI_ICON_OPEN
,
IDI_ICON_CLOSED
,
IDI_ICON_CLASS
,
IDI_ICON_METHOD
,
IDI_ICON_VTABLE
,
IDI_ICON_DELETE
,
IDI_ICON_ADD
,
IDI_ICON_RANDOM
,
IDI_ICON_DROPARROW
,
IDI_ICON_POINTER
,
IDI_ICON_ARRAY
,
IDI_ICON_CUSTOM
,
IDI_ICON_ENUM
,
IDI_ICON_FLOAT
,
IDI_ICON_LEFT
,
IDI_ICON_RIGHT
,
IDI_ICON_MATRIX
,
IDI_ICON_INTEGER
,
IDI_ICON_TEXT
,
IDI_ICON_UNSIGNED
,
IDI_ICON_VECTOR
,
IDI_ICON_CHANGE
,
IDI_ICON_CAMERA
,
IDI_ICON_LIST_ENTRY
};
for
(
auto
id : icons)
g_Icons.
emplace_back
(::
LoadIcon
(hInst,
MAKEINTRESOURCE
(id)));
g_Typedefs.
Hex
=
L"
char
"
;
g_Typedefs.
Int64
=
L"
__int64
"
;
g_Typedefs.
Int32
=
L"
__int32
"
;
g_Typedefs.
Int16
=
L"
__int16
"
;
g_Typedefs.
Int8
=
L"
__int8
"
;
g_Typedefs.
Qword
=
L"
DWORD64
"
;
g_Typedefs.
Dword
=
L"
DWORD
"
;
g_Typedefs.
Word
=
L"
WORD
"
;
g_Typedefs.
Byte
=
L"
unsigned char
"
;
g_Typedefs.
Float
=
L"
float
"
;
g_Typedefs.
Double
=
L"
double
"
;
g_Typedefs.
Vec2
=
L"
Vector2
"
;
//
xy
g_Typedefs.
Vec3
=
L"
Vector3
"
;
//
xyz
g_Typedefs.
Quat
=
L"
Vector4
"
;
//
xyzw
//
matrix3x4_t is a C++ class that represents a matrix.
g_Typedefs.
Matrix
=
L"
matrix3x4_t
"
;
//
float m_matrix[3][4];
g_Typedefs.
PChar
=
L"
char*
"
;
g_Typedefs.
PWChar
=
L"
wchar_t*
"
;
g_Typedefs.
ListEntry
=
L"
LIST_ENTRY
"
;
return
TRUE
;
}
Back
|
FazBrowse Home
|
New Git URL