Skip to content

Commit 77085cc

Browse files
Freestyle-CoderFreestyle-Coder
authored andcommitted
first release
1 parent ac4c106 commit 77085cc

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

borderless.cpp

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#include <windows.h>
2+
#include <cstdio>
3+
4+
HWND getWindow() {
5+
printf("Press CRLT + H to make the currently focussed window borderless\n");
6+
MSG msg;
7+
while (GetMessage(&msg, NULL, 0, 0) != 0) {
8+
if (msg.message == WM_HOTKEY) {
9+
return GetForegroundWindow();
10+
}
11+
}
12+
}
13+
14+
int main() {
15+
RegisterHotKey(NULL, 1, MOD_CONTROL, 0x48);
16+
int screenWidth = GetSystemMetrics(SM_CXSCREEN);
17+
int screenHeigth = GetSystemMetrics(SM_CYSCREEN);
18+
HWND window;
19+
char windowTitle[100];
20+
while (true) {
21+
window = getWindow();
22+
SetWindowLong(window, GWL_STYLE, 0x00000000);
23+
SetWindowLong(window, GWL_STYLE, 0x94000000);
24+
SetWindowPos(window, HWND_TOPMOST, 0, 0, screenWidth, screenHeigth, NULL);
25+
GetWindowText(window, windowTitle, 100);
26+
printf("Set window: %s to borderless\n\n", windowTitle);
27+
}
28+
}

0 commit comments

Comments
 (0)