-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdisable-navigation-bar.wh.cpp
64 lines (51 loc) · 1.71 KB
/
disable-navigation-bar.wh.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
// ==WindhawkMod==
// @id disable-navigation-bar
// @name Disable Navigation Bar
// @description Disables the navigation bar in file explorer
// @version 1.0.0
// @author ItsProfessional
// @github https://github.com/ItsProfessional
// @include *
// ==/WindhawkMod==
// ==WindhawkModReadme==
/*
# Disable Navigation Bar
This mod disables the navigation bar in file explorer.
Note: This mod applies to explorer folders as well as save/open dialogs in all programs.
The code is based on the implementation in [ExplorerPatcher](https://github.com/valinet/ExplorerPatcher).
![Screenshot](https://raw.githubusercontent.com/ItsProfessional/Screenshots/main/Windhawk/disable-navigation-bar.png)
*/
// ==/WindhawkModReadme==
static HWND(__stdcall *ExplorerFrame_SHCreateWorkerWindow)(
WNDPROC wndProc,
HWND hWndParent,
DWORD dwExStyle,
DWORD dwStyle,
HMENU hMenu,
LONG_PTR wnd_extra
);
HWND WINAPI ExplorerFrame_SHCreateWorkerWindowHook(
WNDPROC wndProc,
HWND hWndParent,
DWORD dwExStyle,
DWORD dwStyle,
HMENU hMenu,
LONG_PTR wnd_extra
) {
HWND result;
if (dwExStyle == 0x10000 && dwStyle == 1174405120) return 0;
return ExplorerFrame_SHCreateWorkerWindow(
wndProc,
hWndParent,
dwExStyle,
dwStyle,
hMenu,
wnd_extra
);
}
BOOL Wh_ModInit() {
HMODULE hShcore = GetModuleHandle(L"shcore.dll");
void* origFunc = (void*)GetProcAddress(hShcore, (LPCSTR)188);
Wh_SetFunctionHook(origFunc, (void*)ExplorerFrame_SHCreateWorkerWindowHook, (void**)&ExplorerFrame_SHCreateWorkerWindow);
return TRUE;
}