This repository has been archived by the owner on Nov 15, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hider.cpp
70 lines (59 loc) · 1.65 KB
/
hider.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
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
//
// Created by Xyndra on 28.06.2024.
//
#include "hider.h"
#include <windows.h>
#include <iostream>
#include <vector>
#include "main.h"
void hideMainTaskbar() {
while (running.load()) {
while (FindWindow("Shell_TrayWnd", nullptr) == nullptr) {
Sleep(100);
}
HWND taskbar_hwnd = FindWindow("Shell_TrayWnd", nullptr);
if (IsWindowVisible(taskbar_hwnd) == FALSE) {
Sleep(100);
continue;
}
ShowWindow(taskbar_hwnd, SW_HIDE);
std::cout << "Taskbar hidden" << std::endl;
Sleep(100);
}
}
std::vector<HWND> foundWindows;
BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam) {
char className[200];
GetClassName(hwnd, className, sizeof(className));
std::string targetClass = "Shell_SecondaryTrayWnd";
if (std::string(className) == targetClass) {
foundWindows.push_back(hwnd);
}
return TRUE;
}
void hideSecondaryTaskbars() {
while (running.load()) {
EnumWindows(EnumWindowsProc, 0);
for (HWND hwnd : foundWindows) {
if (IsWindowVisible(hwnd) == TRUE) {
ShowWindow(hwnd, SW_HIDE);
Sleep(100);
std::cout << "Secondary taskbar hidden" << std::endl;
}
}
Sleep(100);
}
}
void showMainTaskbar() {
while (FindWindow("Shell_TrayWnd", nullptr) == nullptr) {
Sleep(100);
}
HWND taskbar_hwnd = FindWindow("Shell_TrayWnd", nullptr);
ShowWindow(taskbar_hwnd, SW_SHOW);
}
void showSecondaryTaskbars() {
EnumWindows(EnumWindowsProc, 0);
for (HWND hwnd : foundWindows) {
ShowWindow(hwnd, SW_SHOW);
}
}