From 46c504172c79f9af5a643d8c131d85b63705b348 Mon Sep 17 00:00:00 2001 From: Valentin Radu Date: Wed, 26 Jul 2023 15:57:53 +0300 Subject: [PATCH 1/6] Start10: Fixed a bug that prevented the menu from working on OS builds 22621.1413 and newer --- ExplorerPatcher/dllmain.c | 9 +++++---- ExplorerPatcher/settings.reg | 2 ++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ExplorerPatcher/dllmain.c b/ExplorerPatcher/dllmain.c index eff4795cf..cb792778c 100644 --- a/ExplorerPatcher/dllmain.c +++ b/ExplorerPatcher/dllmain.c @@ -9245,19 +9245,20 @@ HMODULE patched_LoadLibraryExW(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlag { WCHAR path[MAX_PATH]; GetSystemDirectoryW(path, MAX_PATH); - wcscat_s(path, MAX_PATH, L"\\StartTileData.dll"); + wcscat_s(path, MAX_PATH, L"\\AppResolver.dll"); if (!_wcsicmp(path, lpLibFileName)) { GetWindowsDirectoryW(path, MAX_PATH); - wcscat_s(path, MAX_PATH, L"\\SystemApps\\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\\StartTileDataLegacy.dll"); + wcscat_s(path, MAX_PATH, L"\\SystemApps\\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\\AppResolverLegacy.dll"); return LoadLibraryExW(path, hFile, dwFlags); } + if (IsWindows11Version22H2Build1413OrHigher()) return LoadLibraryExW(lpLibFileName, hFile, dwFlags); GetSystemDirectoryW(path, MAX_PATH); - wcscat_s(path, MAX_PATH, L"\\AppResolver.dll"); + wcscat_s(path, MAX_PATH, L"\\StartTileData.dll"); if (!_wcsicmp(path, lpLibFileName)) { GetWindowsDirectoryW(path, MAX_PATH); - wcscat_s(path, MAX_PATH, L"\\SystemApps\\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\\AppResolverLegacy.dll"); + wcscat_s(path, MAX_PATH, L"\\SystemApps\\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\\StartTileDataLegacy.dll"); return LoadLibraryExW(path, hFile, dwFlags); } return LoadLibraryExW(lpLibFileName, hFile, dwFlags); diff --git a/ExplorerPatcher/settings.reg b/ExplorerPatcher/settings.reg index 6beb14301..c8338b95f 100644 --- a/ExplorerPatcher/settings.reg +++ b/ExplorerPatcher/settings.reg @@ -328,6 +328,8 @@ ;"Virtualized_{D17F1E1A-5919-4427-8F89-A1A8503CA3EB}_NoStartMenuMorePrograms"=dword:00000000 ;u Pin tiles to Windows 10 Start menu from File Explorer ;pin_tiles +;y IMPORTANT, MUST READ: Notice regarding this feature (online) +;https://github.com/valinet/ExplorerPatcher/discussions/1679 ;g StartMenu_Windows10 From 53ff541d784d541f0e0c76c3cd193ef36a8dfc05 Mon Sep 17 00:00:00 2001 From: Valentin Radu Date: Wed, 26 Jul 2023 16:20:42 +0300 Subject: [PATCH 2/6] Version: 22621.1992.56.1 --- CHANGELOG.md | 10 ++++++++++ version.h | 10 +++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 62973d066..e39ff8d0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,16 @@ This document includes the same release notes as in the [Releases](https://github.com/valinet/ExplorerPatcher/releases) section on GitHub. +## 22621.1992.56 + +Tested on OS build 22621.1992. Installer requires Internet connectivity. + +#### Details + +##### 1 + +* Windows 10 Start menu: Fixed a bug that prevented the menu from working on OS builds 22621.1413 and newer (46c5041). Please read these important notes regarding the fix [here](https://github.com/valinet/ExplorerPatcher/discussions/1679). + ## 22621.1555.55 Tested on OS build 22621.1555. Installer requires Internet connectivity. diff --git a/version.h b/version.h index 588214c51..3c4423f65 100644 --- a/version.h +++ b/version.h @@ -1,7 +1,7 @@ #define VER_MAJOR 22621 -#define VER_MINOR 1555 -#define VER_BUILD_HI 55 -#define VER_BUILD_LO 2 +#define VER_MINOR 1992 +#define VER_BUILD_HI 56 +#define VER_BUILD_LO 1 #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", "22621.1555.55.2" -#define VER_PRODUCT_STRING VALUE "ProductVersion", "22621.1555.55.2" +#define VER_FILE_STRING VALUE "FileVersion", "22621.1992.56.1" +#define VER_PRODUCT_STRING VALUE "ProductVersion", "22621.1992.56.1" From 275a91f0d947eb64d2e940d564d384e24fad439f Mon Sep 17 00:00:00 2001 From: Valentin Radu Date: Wed, 23 Aug 2023 03:47:01 -0700 Subject: [PATCH 3/6] Start10: Fixed a bug that prevented centering on Windows 10 --- ExplorerPatcher/dllmain.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ExplorerPatcher/dllmain.c b/ExplorerPatcher/dllmain.c index cb792778c..c747192b9 100644 --- a/ExplorerPatcher/dllmain.c +++ b/ExplorerPatcher/dllmain.c @@ -11041,7 +11041,8 @@ void StartMenu_LoadSettings(BOOL bRestartIfChanged) if (hKey) { dwSize = sizeof(DWORD); - dwVal = 0; + if (IsWindows11()) dwVal = 0; + else dwVal = 1; RegQueryValueExW( hKey, TEXT("Start_ShowClassicMode"), From cfd53c9f2b1ffe9660526a711eb05925eb049470 Mon Sep 17 00:00:00 2001 From: Valentin Radu Date: Wed, 23 Aug 2023 03:49:01 -0700 Subject: [PATCH 4/6] Version: 22621.1992.56.2 --- CHANGELOG.md | 4 ++++ version.h | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e39ff8d0e..5d189dde4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,10 @@ Tested on OS build 22621.1992. Installer requires Internet connectivity. * Windows 10 Start menu: Fixed a bug that prevented the menu from working on OS builds 22621.1413 and newer (46c5041). Please read these important notes regarding the fix [here](https://github.com/valinet/ExplorerPatcher/discussions/1679). +##### 2 + +* Windows 10 Start menu: Fixed a bug that prevented centering on Windows 10 (275a91f). + ## 22621.1555.55 Tested on OS build 22621.1555. Installer requires Internet connectivity. diff --git a/version.h b/version.h index 3c4423f65..de9fae31d 100644 --- a/version.h +++ b/version.h @@ -1,7 +1,7 @@ #define VER_MAJOR 22621 #define VER_MINOR 1992 #define VER_BUILD_HI 56 -#define VER_BUILD_LO 1 +#define VER_BUILD_LO 2 #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", "22621.1992.56.1" -#define VER_PRODUCT_STRING VALUE "ProductVersion", "22621.1992.56.1" +#define VER_FILE_STRING VALUE "FileVersion", "22621.1992.56.2" +#define VER_PRODUCT_STRING VALUE "ProductVersion", "22621.1992.56.2" From 2e43c679b99a09faf965b487bcb7c93519e9a873 Mon Sep 17 00:00:00 2001 From: Valentin Radu Date: Wed, 23 Aug 2023 18:05:01 +0300 Subject: [PATCH 5/6] Taskbar10: Correct centering of taskbar items when search box is enabled in Windows 10 --- ExplorerPatcher/TaskbarCenter.c | 61 ++++++++++++++++++++++++++------- 1 file changed, 49 insertions(+), 12 deletions(-) diff --git a/ExplorerPatcher/TaskbarCenter.c b/ExplorerPatcher/TaskbarCenter.c index bf6b46150..fd93473ce 100644 --- a/ExplorerPatcher/TaskbarCenter.c +++ b/ExplorerPatcher/TaskbarCenter.c @@ -6,6 +6,7 @@ extern HWND PeopleButton_LastHWND; extern DWORD dwWeatherToLeft; extern DWORD dwOldTaskbarAl; extern DWORD dwMMOldTaskbarAl; +extern DWORD dwSearchboxTaskbarMode; extern wchar_t* EP_TASKBAR_LENGTH_PROP_NAME; #define EP_TASKBAR_LENGTH_TOO_SMALL 20 BOOL bTaskbarCenterHasPatchedSHWindowsPolicy = FALSE; @@ -144,9 +145,11 @@ BOOL TaskbarCenter_GetClientRectHook(HWND hWnd, LPRECT lpRect) { GetClientRect(hWndStart, &rcStart); HWND hTrayButton = NULL; - while (hTrayButton = FindWindowExW(hWndTaskbar, hTrayButton, L"TrayButton", NULL)) + wchar_t* pCn = L"TrayButton"; + if (!IsWindows11() && dwSearchboxTaskbarMode == 2) pCn = L"TrayDummySearchControl"; + while (hTrayButton = FindWindowExW(hWndTaskbar, hTrayButton, pCn, NULL)) { - if (!IsWindowVisible(hTrayButton)) continue; + if (pCn == L"TrayButton" && !IsWindowVisible(hTrayButton)) continue; RECT rcTrayButton; GetClientRect(hTrayButton, &rcTrayButton); if (bIsTaskbarHorizontal) @@ -157,6 +160,10 @@ BOOL TaskbarCenter_GetClientRectHook(HWND hWnd, LPRECT lpRect) { rcStart.bottom += (rcTrayButton.bottom - rcTrayButton.top); } + if (pCn == L"TrayDummySearchControl") { + pCn = L"TrayButton"; + hTrayButton = NULL; + } } } RECT rc; @@ -180,13 +187,19 @@ BOOL TaskbarCenter_GetClientRectHook(HWND hWnd, LPRECT lpRect) GetClientRect(hWndStart, &rcTrayButton); DWORD dwDim = (rcTrayButton.right - rcTrayButton.left); HWND hTrayButton = NULL; - while (hTrayButton = FindWindowExW(hWndTaskbar, hTrayButton, L"TrayButton", NULL)) + wchar_t* pCn = L"TrayButton"; + if (!IsWindows11() && dwSearchboxTaskbarMode == 2) pCn = L"TrayDummySearchControl"; + while (hTrayButton = FindWindowExW(hWndTaskbar, hTrayButton, pCn, NULL)) { - if (!IsWindowVisible(hTrayButton)) continue; + if (pCn == L"TrayButton" && !IsWindowVisible(hTrayButton)) continue; GetClientRect(hTrayButton, &rcTrayButton); MoveWindow(hTrayButton, ((mi.rcMonitor.right - mi.rcMonitor.left) - (rcStart.right - rcStart.left)) / 2 + dwDim, rcStart.top, rcTrayButton.right, rcTrayButton.bottom, TRUE); if (!bIsPrimaryTaskbar) InvalidateRect(hTrayButton, NULL, TRUE); dwDim += (rcTrayButton.right - rcTrayButton.left); + if (pCn == L"TrayDummySearchControl") { + pCn = L"TrayButton"; + hTrayButton = NULL; + } } } else @@ -196,13 +209,19 @@ BOOL TaskbarCenter_GetClientRectHook(HWND hWnd, LPRECT lpRect) GetClientRect(hWndStart, &rcTrayButton); DWORD dwDim = (rcTrayButton.bottom - rcTrayButton.top); HWND hTrayButton = NULL; - while (hTrayButton = FindWindowExW(hWndTaskbar, hTrayButton, L"TrayButton", NULL)) + wchar_t* pCn = L"TrayButton"; + if (!IsWindows11() && dwSearchboxTaskbarMode == 2) pCn = L"TrayDummySearchControl"; + while (hTrayButton = FindWindowExW(hWndTaskbar, hTrayButton, pCn, NULL)) { - if (!IsWindowVisible(hTrayButton)) continue; + if (pCn == L"TrayButton" && !IsWindowVisible(hTrayButton)) continue; GetClientRect(hTrayButton, &rcTrayButton); MoveWindow(hTrayButton, rcStart.left, ((mi.rcMonitor.bottom - mi.rcMonitor.top) - (rcStart.bottom - rcStart.top)) / 2 + dwDim, rcTrayButton.right, rcTrayButton.bottom, TRUE); InvalidateRect(hTrayButton, NULL, TRUE); dwDim += (rcTrayButton.bottom - rcTrayButton.top); + if (pCn == L"TrayDummySearchControl") { + pCn = L"TrayButton"; + hTrayButton = NULL; + } } } if (!bIsPrimaryTaskbar) InvalidateRect(hWndStart, NULL, TRUE); @@ -310,13 +329,19 @@ BOOL TaskbarCenter_GetClientRectHook(HWND hWnd, LPRECT lpRect) GetClientRect(hWndStart, &rcTrayButton); DWORD dwDim = (rcTrayButton.right - rcTrayButton.left); HWND hTrayButton = NULL; - while (hTrayButton = FindWindowExW(hWndTaskbar, hTrayButton, L"TrayButton", NULL)) + wchar_t* pCn = L"TrayButton"; + if (!IsWindows11() && dwSearchboxTaskbarMode == 2) pCn = L"TrayDummySearchControl"; + while (hTrayButton = FindWindowExW(hWndTaskbar, hTrayButton, pCn, NULL)) { - if (!IsWindowVisible(hTrayButton)) continue; + if (pCn == L"TrayButton" && !IsWindowVisible(hTrayButton)) continue; GetClientRect(hTrayButton, &rcTrayButton); MoveWindow(hTrayButton, (rc.left - mi.rcMonitor.left) + lpRect->left - (rcStart.right - rcStart.left) + dwDim, rcStart.top, rcTrayButton.right, rcTrayButton.bottom, TRUE); if (!bIsPrimaryTaskbar) InvalidateRect(hTrayButton, NULL, TRUE); dwDim += (rcTrayButton.right - rcTrayButton.left); + if (pCn == L"TrayDummySearchControl") { + pCn = L"TrayButton"; + hTrayButton = NULL; + } } } else @@ -326,13 +351,19 @@ BOOL TaskbarCenter_GetClientRectHook(HWND hWnd, LPRECT lpRect) GetClientRect(hWndStart, &rcTrayButton); DWORD dwDim = (rcTrayButton.bottom - rcTrayButton.top); HWND hTrayButton = NULL; - while (hTrayButton = FindWindowExW(hWndTaskbar, hTrayButton, L"TrayButton", NULL)) + wchar_t* pCn = L"TrayButton"; + if (!IsWindows11() && dwSearchboxTaskbarMode == 2) pCn = L"TrayDummySearchControl"; + while (hTrayButton = FindWindowExW(hWndTaskbar, hTrayButton, pCn, NULL)) { - if (!IsWindowVisible(hTrayButton)) continue; + if (pCn == L"TrayButton" && !IsWindowVisible(hTrayButton)) continue; GetClientRect(hTrayButton, &rcTrayButton); MoveWindow(hTrayButton, rcStart.left, (rc.top - mi.rcMonitor.top) + lpRect->top - (rcStart.bottom - rcStart.top) + dwDim, rcTrayButton.right, rcTrayButton.bottom, TRUE); InvalidateRect(hTrayButton, NULL, TRUE); dwDim += (rcTrayButton.bottom - rcTrayButton.top); + if (pCn == L"TrayDummySearchControl") { + pCn = L"TrayButton"; + hTrayButton = NULL; + } } } if (!bIsPrimaryTaskbar) InvalidateRect(hWndStart, NULL, TRUE); @@ -442,9 +473,11 @@ BOOL TaskbarCenter_GetClientRectHook(HWND hWnd, LPRECT lpRect) GetClientRect(hWndStart, &rcTrayButton); DWORD dwDim = bIsTaskbarHorizontal ? (rcTrayButton.right - rcTrayButton.left) : (rcTrayButton.bottom - rcTrayButton.top); HWND hTrayButton = NULL; - while (hTrayButton = FindWindowExW(hWndTaskbar, hTrayButton, L"TrayButton", NULL)) + wchar_t* pCn = L"TrayButton"; + if (!IsWindows11() && dwSearchboxTaskbarMode == 2) pCn = L"TrayDummySearchControl"; + while (hTrayButton = FindWindowExW(hWndTaskbar, hTrayButton, pCn, NULL)) { - if (!IsWindowVisible(hTrayButton)) continue; + if (pCn == L"TrayButton" && !IsWindowVisible(hTrayButton)) continue; GetClientRect(hTrayButton, &rcTrayButton); if (bIsTaskbarHorizontal) { @@ -456,6 +489,10 @@ BOOL TaskbarCenter_GetClientRectHook(HWND hWnd, LPRECT lpRect) } if (!bIsPrimaryTaskbar || !bIsTaskbarHorizontal) InvalidateRect(hTrayButton, NULL, TRUE); dwDim += bIsTaskbarHorizontal ? (rcTrayButton.right - rcTrayButton.left) : (rcTrayButton.bottom - rcTrayButton.top); + if (pCn == L"TrayDummySearchControl") { + pCn = L"TrayButton"; + hTrayButton = NULL; + } } } } From 5bda71f1846df820e60eee4e70ad253fe20a6180 Mon Sep 17 00:00:00 2001 From: Valentin Radu Date: Wed, 23 Aug 2023 18:06:23 +0300 Subject: [PATCH 6/6] Version: 22621.1992.56.3 --- CHANGELOG.md | 4 ++++ version.h | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d189dde4..06b42f179 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,10 @@ Tested on OS build 22621.1992. Installer requires Internet connectivity. * Windows 10 Start menu: Fixed a bug that prevented centering on Windows 10 (275a91f). +##### 3 + +* Windows 10 taskbar: Correct centering of taskbar items when search box is enabled in Windows 10 (2e43c67). + ## 22621.1555.55 Tested on OS build 22621.1555. Installer requires Internet connectivity. diff --git a/version.h b/version.h index de9fae31d..f1455fb9b 100644 --- a/version.h +++ b/version.h @@ -1,7 +1,7 @@ #define VER_MAJOR 22621 #define VER_MINOR 1992 #define VER_BUILD_HI 56 -#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", "22621.1992.56.2" -#define VER_PRODUCT_STRING VALUE "ProductVersion", "22621.1992.56.2" +#define VER_FILE_STRING VALUE "FileVersion", "22621.1992.56.3" +#define VER_PRODUCT_STRING VALUE "ProductVersion", "22621.1992.56.3"