From 085b3dd9f7062dc4bde720a0f8fd1f27442e8300 Mon Sep 17 00:00:00 2001 From: Valentin Radu Date: Wed, 4 Oct 2023 02:33:55 +0300 Subject: [PATCH] Taskbar11: Fixed a bug that reset the "never combine" setting on OS builds 22621.2361+ --- ExplorerPatcher/dllmain.c | 51 ++++++++----------------------------- ExplorerPatcher/lvt.h | 1 + ExplorerPatcher/osutility.h | 7 +++++ 3 files changed, 18 insertions(+), 41 deletions(-) diff --git a/ExplorerPatcher/dllmain.c b/ExplorerPatcher/dllmain.c index 2c96e072a..ae18d82a3 100644 --- a/ExplorerPatcher/dllmain.c +++ b/ExplorerPatcher/dllmain.c @@ -11506,51 +11506,20 @@ DWORD Inject(BOOL bIsExplorer) ResetEvent(hEvent); }*/ - if (bOldTaskbar) - { - if (IsWindows11()) - { - CreateThread( - 0, - 0, - PlayStartupSound, - 0, - 0, - 0 - ); + if (IsWindows11()) { + if (bOldTaskbar) { + CreateThread(0, 0, PlayStartupSound, 0, 0, 0); printf("Play startup sound thread...\n"); - } - } - - - if (bOldTaskbar) - { - if (IsWindows11()) - { - CreateThread( - 0, - 0, - SignalShellReady, - dwExplorerReadyDelay, - 0, - 0 - ); + CreateThread(0, 0, SignalShellReady, dwExplorerReadyDelay, 0, 0); printf("Signal shell ready...\n"); + } else { + CreateThread(0, 0, FixTaskbarAutohide, 0, 0, 0); + if (!IsWindows11Version22H2Build2361OrHigher()) { + RegDeleteKeyValueW(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced", L"TaskbarGlomLevel"); + RegDeleteKeyValueW(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced", L"MMTaskbarGlomLevel"); + } } } - else - { - CreateThread( - 0, - 0, - FixTaskbarAutohide, - 0, - 0, - 0 - ); - RegDeleteKeyValueW(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced", L"TaskbarGlomLevel"); - RegDeleteKeyValueW(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced", L"MMTaskbarGlomLevel"); - } if (IsWindows11Version22H2OrHigher() && bOldTaskbar) { diff --git a/ExplorerPatcher/lvt.h b/ExplorerPatcher/lvt.h index 49691b69c..4cd1515a9 100644 --- a/ExplorerPatcher/lvt.h +++ b/ExplorerPatcher/lvt.h @@ -7,6 +7,7 @@ #include #include #include +#include "osutility.h" #define LVT_LOC_NONE 0 #define LVT_LOC_BOTTOMLEFT 1 diff --git a/ExplorerPatcher/osutility.h b/ExplorerPatcher/osutility.h index affc78c85..833b6484c 100644 --- a/ExplorerPatcher/osutility.h +++ b/ExplorerPatcher/osutility.h @@ -87,4 +87,11 @@ inline BOOL IsWindows11Version22H2Build2134OrHigher() if (global_rovi.dwBuildNumber > 22621) return TRUE; return global_rovi.dwBuildNumber == 22621 && global_ubr >= 2134; } + +inline BOOL IsWindows11Version22H2Build2361OrHigher() +{ + if (!global_rovi.dwMajorVersion) global_ubr = VnGetOSVersionAndUBR(&global_rovi); + if (global_rovi.dwBuildNumber > 22621) return TRUE; + return global_rovi.dwBuildNumber == 22621 && global_ubr >= 2361; +} #endif