From cd2f828b087de01f42163565b8fde7d242c59701 Mon Sep 17 00:00:00 2001 From: Valentin Radu Date: Fri, 14 Jan 2022 11:56:43 +0200 Subject: [PATCH] Attempt to fix #664 (W10 taskbar buttons sometimes becoming too large when never combine is used and DPI/resolution changes) --- CHANGELOG.md | 1 + ExplorerPatcher/dllmain.c | 21 +++++++++++++++++++++ version.h | 6 +++--- 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 167fef6..5927e44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,7 @@ Tested on OS build 22000.434. * Fixed a bug that could unexpectedly prevent the [Win]+[Alt]+[D] shortcut from working properly * Windows 10 language switcher displays correctly when the taskbar is placed in some location other than the bottom of the screen (#629) (.2) * Available symbols download properly on Insider builds (tested on 22526.1000) (.3) +* Mitigated an `explorer.exe` bug where Windows 10 taskbar buttons were becoming too large under certain circumstances when the setting to show labels/never combine is used and the screen resolution/DPI changes (#664) (.6) ## 22000.376.40 diff --git a/ExplorerPatcher/dllmain.c b/ExplorerPatcher/dllmain.c index 058f111..e0b5b23 100644 --- a/ExplorerPatcher/dllmain.c +++ b/ExplorerPatcher/dllmain.c @@ -7051,6 +7051,27 @@ DWORD Inject(BOOL bIsExplorer) } + DWORD dwSize = 0; + if (SHRegGetValueFromHKCUHKLMFunc && SHRegGetValueFromHKCUHKLMFunc( + L"Control Panel\\Desktop\\WindowMetrics", + L"MinWidth", + SRRF_RT_REG_SZ, + NULL, + NULL, + (LPDWORD)(&dwSize) + ) != ERROR_SUCCESS) + { + RegSetKeyValueW( + HKEY_CURRENT_USER, + L"Control Panel\\Desktop\\WindowMetrics", + L"MinWidth", + REG_SZ, + L"38", + sizeof(L"38") + ); + } + + CreateThread( 0, 0, diff --git a/version.h b/version.h index 7845ab1..f3d645c 100644 --- a/version.h +++ b/version.h @@ -1,7 +1,7 @@ #define VER_MAJOR 22000 #define VER_MINOR 434 #define VER_BUILD_HI 41 -#define VER_BUILD_LO 5 +#define VER_BUILD_LO 6 #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.434.41.5" -#define VER_PRODUCT_STRING VALUE "ProductVersion", "22000.434.41.5" +#define VER_FILE_STRING VALUE "FileVersion", "22000.434.41.6" +#define VER_PRODUCT_STRING VALUE "ProductVersion", "22000.434.41.6"