diff --git a/ExplorerPatcher/dllmain.c b/ExplorerPatcher/dllmain.c index 9814367..2a062f5 100644 --- a/ExplorerPatcher/dllmain.c +++ b/ExplorerPatcher/dllmain.c @@ -105,6 +105,7 @@ BOOL bDoNotRedirectProgramsAndFeaturesToSettingsApp = FALSE; BOOL bDoNotRedirectDateAndTimeToSettingsApp = FALSE; BOOL bDoNotRedirectNotificationIconsToSettingsApp = FALSE; BOOL bDisableOfficeHotkeys = FALSE; +BOOL bDisableWinFHotkey = FALSE; DWORD bNoPropertiesInContextMenu = FALSE; #define TASKBARGLOMLEVEL_DEFAULT 2 #define MMTASKBARGLOMLEVEL_DEFAULT 2 @@ -863,6 +864,8 @@ DWORD EP_ServiceWindowThread(DWORD unused) #pragma region "Toggle shell features" +// More details in explorer.exe!CTray::_HandleGlobalHotkey + BOOL CALLBACK ToggleImmersiveCallback(HWND hWnd, LPARAM lParam) { WORD ClassWord; @@ -4066,13 +4069,7 @@ FARPROC explorer_GetProcAddressHook(HMODULE hModule, const CHAR* lpProcName) #ifdef _WIN64 LRESULT explorer_SendMessageW(HWND hWndx, UINT uMsg, WPARAM wParam, LPARAM lParam) { - if (uMsg == 0x579) // "Raise desktop" - basically shows desktop or the windows - // wParam = 3 => show desktop - // wParam = 2 => raise windows - { - - } - else if (uMsg == TB_GETTEXTROWS) + if (uMsg == TB_GETTEXTROWS) { HWND hWnd = FindWindowEx( NULL, @@ -6276,6 +6273,15 @@ void WINAPI LoadSettings(LPARAM lParam) &bDisableOfficeHotkeys, &dwSize ); + dwSize = sizeof(DWORD); + RegQueryValueExW( + hKey, + TEXT("DisableWinFHotkey"), + 0, + NULL, + &bDisableWinFHotkey, + &dwSize + ); dwTemp = FALSE; dwSize = sizeof(DWORD); RegQueryValueExW( @@ -8854,6 +8860,16 @@ BOOL explorer_RegisterHotkeyHook(HWND hWnd, int id, UINT fsModifiers, UINT vk) } return RegisterHotKey(hWnd, id, fsModifiers, vk); } + +BOOL twinui_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 RegisterHotKey(hWnd, id, fsModifiers, vk); +} #pragma endregion @@ -9785,12 +9801,17 @@ DWORD Inject(BOOL bIsExplorer) printf("Setup twinui.pcshell functions done\n"); + + HANDLE hTwinui = LoadLibraryW(L"twinui.dll"); if (!IsWindows11()) { - HANDLE hTwinui = LoadLibraryW(L"twinui.dll"); VnPatchIAT(hTwinui, "user32.dll", "TrackPopupMenu", twinui_TrackPopupMenuHook); - printf("Setup twinui functions done\n"); } + if (bDisableWinFHotkey) + { + VnPatchIAT(hTwinui, "user32.dll", "RegisterHotKey", twinui_RegisterHotkeyHook); + } + printf("Setup twinui functions done\n"); HANDLE hStobject = LoadLibraryW(L"stobject.dll"); @@ -9964,7 +9985,6 @@ DWORD Inject(BOOL bIsExplorer) - rv = funchook_install(funchook, 0); if (rv != 0) { @@ -10092,6 +10112,7 @@ DWORD Inject(BOOL bIsExplorer) } + if (bEnableArchivePlugin) { ArchiveMenuThreadParams* params = calloc(1, sizeof(ArchiveMenuThreadParams)); diff --git a/ExplorerPatcher/settings.reg b/ExplorerPatcher/settings.reg index d7f9d65..af971bb 100644 --- a/ExplorerPatcher/settings.reg +++ b/ExplorerPatcher/settings.reg @@ -534,6 +534,8 @@ "NoMenuAccelerator"=dword:00000000 ;b Disable Office hotkeys (Ctrl+Alt+Shift+Windows key combinations) * "DisableOfficeHotkeys"=dword:00000000 +;b Disable Win+F (Feedback Hub) hotkey * +"DisableWinFHotkey"=dword:00000000 ;b Disable rounded corners for application windows ;"Virtualized_{D17F1E1A-5919-4427-8F89-A1A8503CA3EB}_DisableRoundedCorners"=dword:00000000 [HKEY_CURRENT_USER\Software\ExplorerPatcher] diff --git a/ExplorerPatcher/settings10.reg b/ExplorerPatcher/settings10.reg index c944c8e..2b0bf80 100644 --- a/ExplorerPatcher/settings10.reg +++ b/ExplorerPatcher/settings10.reg @@ -474,6 +474,8 @@ "NoMenuAccelerator"=dword:00000000 ;b Disable Office hotkeys (Ctrl+Alt+Shift+Windows key combinations) * "DisableOfficeHotkeys"=dword:00000000 +;b Disable Win+F (Feedback Hub) hotkey * +"DisableWinFHotkey"=dword:00000000 [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced] ;c 6 Default action in the Alt+F4 dialog on the desktop ;x 256 Switch user