From cd8cbecfa0b0af47bf9afd35d69568ca797a3970 Mon Sep 17 00:00:00 2001 From: Valentin Radu Date: Fri, 19 Nov 2021 18:19:58 +0200 Subject: [PATCH] Implemented #389 --- CHANGELOG.md | 2 ++ ExplorerPatcher/dllmain.c | 25 +++++++++++++++++++++++++ ExplorerPatcher/settings.reg | 9 ++++++++- version.h | 6 +++--- 4 files changed, 38 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b09cb3..576730f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ Tested on build 22000.318 and 22000.346 (currently in Windows Insider beta and r * `ep-setup /extract test` - extracts to `test` folder in current directory * `ep-setup /extract "C:\test with space"` - extracts to `C:\test with space` directory * Taskbar toolbar layouts are preserved when switching between Windows 10 and Windows 11 taskbars and in general (these will be reset when installing this update but should be subsequently remembered) (#395) (.2) +* Implemented option to toggle taskbar auto-hide when double clicking the main taskbar (#389) (.3) #### Feature enhancements @@ -26,6 +27,7 @@ Tested on build 22000.318 and 22000.346 (currently in Windows Insider beta and r #### Fixes * Windows 10 network and battery flyout should now always launch when the tray icon is clicked (#410) (.1) +* Fixed mismatches between defaults from EP and Windows' defaults (.3) ## 22000.318.37 diff --git a/ExplorerPatcher/dllmain.c b/ExplorerPatcher/dllmain.c index a1d088d..b0d3369 100644 --- a/ExplorerPatcher/dllmain.c +++ b/ExplorerPatcher/dllmain.c @@ -71,6 +71,7 @@ DWORD dwIMEStyle = 0; DWORD dwTaskbarAl = 1; DWORD bShowUpdateToast = FALSE; DWORD bToolbarSeparators = FALSE; +DWORD bTaskbarAutohideOnDoubleClick = FALSE; HMODULE hModule = NULL; HANDLE hDelayedInjectionThread = NULL; HANDLE hIsWinXShown = NULL; @@ -1350,6 +1351,21 @@ INT64 Shell_TrayWndSubclassProc( { RemoveWindowSubclass(hWnd, Shell_TrayWndSubclassProc, Shell_TrayWndSubclassProc); } + else if (uMsg == WM_LBUTTONDBLCLK && bTaskbarAutohideOnDoubleClick) + { + APPBARDATA abd; + abd.cbSize = sizeof(APPBARDATA); + if (SHAppBarMessage(ABM_GETSTATE, &abd) == ABS_AUTOHIDE) + { + abd.lParam = 0; + SHAppBarMessage(ABM_SETSTATE, &abd); + } + else + { + abd.lParam = ABS_AUTOHIDE; + SHAppBarMessage(ABM_SETSTATE, &abd); + } + } else if (uMsg == WM_HOTKEY && wParam == 500 && lParam == MAKELPARAM(MOD_WIN, 0x41)) { InvokeActionCenter(); @@ -3683,6 +3699,15 @@ void WINAPI LoadSettings(BOOL bIsExplorer) &dwSize ); dwSize = sizeof(DWORD); + RegQueryValueExW( + hKey, + TEXT("TaskbarAutohideOnDoubleClick"), + 0, + NULL, + &bTaskbarAutohideOnDoubleClick, + &dwSize + ); + dwSize = sizeof(DWORD); dwTemp = 0; RegQueryValueExW( hKey, diff --git a/ExplorerPatcher/settings.reg b/ExplorerPatcher/settings.reg index d0afd4b..0c0d6ae 100644 --- a/ExplorerPatcher/settings.reg +++ b/ExplorerPatcher/settings.reg @@ -1,7 +1,9 @@ Windows Registry Editor Version 5.00 + ;M Settings + ;T Taskbar [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\ExplorerPatcher] ;z 2 Taskbar style * @@ -51,6 +53,7 @@ ;b Show separators between toolbars * "ToolbarSeparators"=dword:00000000 + ;T System tray [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced] ;b Show seconds in the clock @@ -113,6 +116,7 @@ ;x 5 "OOBE" "IMEStyle"=dword:00000000 + ;T File Explorer [-HKEY_CURRENT_USER\Software\Classes\CLSID\{d93ed569-3b3e-4bff-8355-3c44f6a52bb5}\InprocServer32] ;d Disable the Windows 11 command bar * @@ -138,13 +142,13 @@ [-HKEY_LOCAL_MACHINE\Software\Classes\CLSID\{D17F1E1A-5919-4427-8F89-A1A8503CA3EB}\InprocServer32] ;d Register as shell extension @="{64bc32b5-4eec-4de7-972d-bd8bd0324537}" - ;t ________________________ ;e For the settings marked with (**) to work in Open/Save file dialogs as well, register ;e this utility as shell extension using the option above. ;y Learn more 🡕 ;https://github.com/valinet/ExplorerPatcher/wiki/Using-ExplorerPatcher-as-shell-extension + ;T Start menu [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StartPage] ;i Open Start on monitor containing the cursor @@ -300,6 +304,8 @@ "LastSectionInProperties"=dword:00000000 ;b Open clock flyout when pressing Win+C instead of Microsoft Teams "ClockFlyoutOnWinC"=dword:00000000 +;b Toggle Windows 10 taskbar auto-hide by double clicking on the main taskbar +"TaskbarAutohideOnDoubleClick"=dword:00000000 [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced] ;b Show Command Prompt instead of PowerShell in Win+X menu * "DontUsePowerShellOnWinX"=dword:00000000 @@ -418,6 +424,7 @@ ;y Frequently Asked Questions 🡕 ;https://github.com/valinet/ExplorerPatcher/wiki/Frequently-asked-questions + ;f ;t For settings marked with * to take effect, restart File Explorer. ;u Restart File Explorer diff --git a/version.h b/version.h index d949be9..ea97186 100644 --- a/version.h +++ b/version.h @@ -1,7 +1,7 @@ #define VER_MAJOR 22000 #define VER_MINOR 318 #define VER_BUILD_HI 38 -#define VER_BUILD_LO 2 +#define VER_BUILD_LO 3 #define VER_FLAGS VS_FF_PRERELEASE @@ -12,5 +12,5 @@ #define VER_STR(arg) #arg // The String form of the version numbers -#define VER_FILE_STRING VALUE "FileVersion", "22000.318.38.2" -#define VER_PRODUCT_STRING VALUE "ProductVersion", "22000.318.38.2" +#define VER_FILE_STRING VALUE "FileVersion", "22000.318.38.3" +#define VER_PRODUCT_STRING VALUE "ProductVersion", "22000.318.38.3"