-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathOverlay.cpp
44 lines (39 loc) · 1.08 KB
/
Overlay.cpp
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
#include "pch.h"
Overlay* g_pOverlay = new Overlay();
Overlay::Overlay() {}
Overlay::~Overlay() {}
void Overlay::createWindow()
{
HWND hwndMain;
hwndMain = FindWindowEx(NULL, NULL, L"TXGuiFoundation", L"Gameloop");
if (IsWindow(hwndMain))
{
HWND hwndSub = FindWindowEx(hwndMain, NULL, L"AEngineRenderWindowClass", NULL);
RECT rect;
GetWindowRect(hwndSub, &rect);
left = rect.left;
top = rect.top;
width = rect.right - rect.left;
height = rect.bottom - rect.top;
}
else
{
left = 0;
top = 0;
width = GetSystemMetrics(SM_CXSCREEN) - 2;
height = GetSystemMetrics(SM_CYSCREEN) - 2;
}
settings.antialiasingLevel = 4;
window.create(
sf::VideoMode(width, height),
"PUBG Corona Drawings",
sf::Style::None,
settings
);
HWND hwnd = window.getSystemHandle();
SetWindowLong(hwnd, GWL_EXSTYLE, WS_EX_TRANSPARENT | WS_EX_LAYERED);
SetLayeredWindowAttributes(hwnd, 0, 255, LWA_ALPHA);
DwmExtendFrameIntoClientArea(hwnd, &margin);
SetWindowPos(hwnd, HWND_TOPMOST, left, top, width, height, SWP_SHOWWINDOW);
UpdateWindow(hwnd);
}