-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdisable-feedback-hub-hotkey.wh.cpp
39 lines (31 loc) · 1.11 KB
/
disable-feedback-hub-hotkey.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
// ==WindhawkMod==
// @id disable-feedback-hub-hotkey
// @name Disable Feedback Hub Hotkey
// @description Disables the feedback hub (Win+F) hotkey in Windows
// @version 1.0.0
// @author ItsProfessional
// @github https://github.com/ItsProfessional
// @include explorer.exe
// ==/WindhawkMod==
// ==WindhawkModReadme==
/*
# Disable Feedback Hub Hotkey
This mod disables the feedback hub (Win+F) hotkey in Windows.
*/
// ==/WindhawkModReadme==
BOOL(*pOriginalRegisterHotKey)(HWND hWnd, int id, UINT fsModifiers, UINT vk);
BOOL RegisterHotKeyHook(HWND hWnd, int id, UINT fsModifiers, UINT vk)
{
if (fsModifiers == (MOD_WIN | MOD_NOREPEAT) && vk == 'F')
{
SetLastError(ERROR_HOTKEY_ALREADY_REGISTERED);
return FALSE;
}
return pOriginalRegisterHotKey(hWnd, id, fsModifiers, vk);
}
BOOL Wh_ModInit() {
HMODULE hUser32 = GetModuleHandle(L"user32.dll");
void* origFunc = (void*)GetProcAddress(hUser32, "RegisterHotKey");
Wh_SetFunctionHook(origFunc, (void*)RegisterHotKeyHook, (void**)&pOriginalRegisterHotKey);
return TRUE;
}