diff --git a/ExplorerPatcher/dllmain.c b/ExplorerPatcher/dllmain.c index 072764f..6256739 100644 --- a/ExplorerPatcher/dllmain.c +++ b/ExplorerPatcher/dllmain.c @@ -9589,7 +9589,7 @@ int StartUI_SetWindowRgn(HWND hWnd, HRGN hRgn, BOOL bRedraw) HRESULT hr = IsThreadCoreWindowVisible(&bIsWindowVisible); if (SUCCEEDED(hr)) { - ShowWindow(hWnd, bIsWindowVisible ? SW_SHOW : SW_HIDE); + if (IsWindows11()) ShowWindow(hWnd, bIsWindowVisible ? SW_SHOW : SW_HIDE); DWORD TaskbarAl = InterlockedAdd(&dwTaskbarAl, 0); if (bIsWindowVisible && (!TaskbarAl ? StartUI_EnableRoundedCornersApply : 1)) { @@ -10125,7 +10125,7 @@ void InjectStartMenu() StartMenu_LoadSettings(FALSE); - if (dwStartShowClassicMode) + if (dwStartShowClassicMode || !IsWindows11()) { LoadLibraryW(L"StartUI.dll"); hStartUI = GetModuleHandleW(L"StartUI.dll"); @@ -10133,25 +10133,28 @@ void InjectStartMenu() // Fixes hang when Start menu closes VnPatchDelayIAT(hStartUI, "ext-ms-win-ntuser-draw-l1-1-0.dll", "SetWindowRgn", StartUI_SetWindowRgn); - // Redirects to StartTileData from 22000.51 which works with the legacy menu - LoadLibraryW(L"combase.dll"); - HANDLE hCombase = GetModuleHandleW(L"combase.dll"); - VnPatchIAT(hCombase, "api-ms-win-core-libraryloader-l1-2-0.dll", "LoadLibraryExW", patched_LoadLibraryExW); - - // Redirects to pri files from 22000.51 which work with the legacy menu - LoadLibraryW(L"MrmCoreR.dll"); - HANDLE hMrmCoreR = GetModuleHandleW(L"MrmCoreR.dll"); - VnPatchIAT(hMrmCoreR, "api-ms-win-core-file-l1-1-0.dll", "CreateFileW", StartUI_CreateFileW); - VnPatchIAT(hMrmCoreR, "api-ms-win-core-file-l1-1-0.dll", "GetFileAttributesExW", StartUI_GetFileAttributesExW); - VnPatchIAT(hMrmCoreR, "api-ms-win-core-file-l1-1-0.dll", "FindFirstFileW", StartUI_FindFirstFileW); - VnPatchIAT(hMrmCoreR, "api-ms-win-core-registry-l1-1-0.dll", "RegGetValueW", StartUI_RegGetValueW); - - // Enables "Show more tiles" setting - LoadLibraryW(L"Windows.CloudStore.dll"); - HANDLE hWindowsCloudStore = GetModuleHandleW(L"Windows.CloudStore.dll"); - VnPatchIAT(hWindowsCloudStore, "api-ms-win-core-registry-l1-1-0.dll", "RegOpenKeyExW", StartUI_RegOpenKeyExW); - VnPatchIAT(hWindowsCloudStore, "api-ms-win-core-registry-l1-1-0.dll", "RegQueryValueExW", StartUI_RegQueryValueExW); - VnPatchIAT(hWindowsCloudStore, "api-ms-win-core-registry-l1-1-0.dll", "RegCloseKey", StartUI_RegCloseKey); + if (IsWindows11()) + { + // Redirects to StartTileData from 22000.51 which works with the legacy menu + LoadLibraryW(L"combase.dll"); + HANDLE hCombase = GetModuleHandleW(L"combase.dll"); + VnPatchIAT(hCombase, "api-ms-win-core-libraryloader-l1-2-0.dll", "LoadLibraryExW", patched_LoadLibraryExW); + + // Redirects to pri files from 22000.51 which work with the legacy menu + LoadLibraryW(L"MrmCoreR.dll"); + HANDLE hMrmCoreR = GetModuleHandleW(L"MrmCoreR.dll"); + VnPatchIAT(hMrmCoreR, "api-ms-win-core-file-l1-1-0.dll", "CreateFileW", StartUI_CreateFileW); + VnPatchIAT(hMrmCoreR, "api-ms-win-core-file-l1-1-0.dll", "GetFileAttributesExW", StartUI_GetFileAttributesExW); + VnPatchIAT(hMrmCoreR, "api-ms-win-core-file-l1-1-0.dll", "FindFirstFileW", StartUI_FindFirstFileW); + VnPatchIAT(hMrmCoreR, "api-ms-win-core-registry-l1-1-0.dll", "RegGetValueW", StartUI_RegGetValueW); + + // Enables "Show more tiles" setting + LoadLibraryW(L"Windows.CloudStore.dll"); + HANDLE hWindowsCloudStore = GetModuleHandleW(L"Windows.CloudStore.dll"); + VnPatchIAT(hWindowsCloudStore, "api-ms-win-core-registry-l1-1-0.dll", "RegOpenKeyExW", StartUI_RegOpenKeyExW); + VnPatchIAT(hWindowsCloudStore, "api-ms-win-core-registry-l1-1-0.dll", "RegQueryValueExW", StartUI_RegQueryValueExW); + VnPatchIAT(hWindowsCloudStore, "api-ms-win-core-registry-l1-1-0.dll", "RegCloseKey", StartUI_RegCloseKey); + } } else { @@ -10523,10 +10526,7 @@ HRESULT EntryPoint(DWORD dwMethod) } else if (bIsThisStartMEH) { - if (IsWindows11()) - { - InjectStartMenu(); - } + InjectStartMenu(); IncrementDLLReferenceCount(hModule); bInstanced = TRUE; } diff --git a/ExplorerPatcher/settings10.reg b/ExplorerPatcher/settings10.reg index 910ff74..511ad19 100644 --- a/ExplorerPatcher/settings10.reg +++ b/ExplorerPatcher/settings10.reg @@ -48,6 +48,20 @@ ;x 0 Windows 10 (default) ;x 1 Windows 11 "OrbStyle"=dword:00000000 +;c 5 Primary taskbar alignment +;x 0 At screen edge (default) +;x 1 Centered +;x 5 Centered, at screen edge when full +;x 3 Centered with Start button +;x 7 Centered with Start button, at screen edge when full +"OldTaskbarAl"=dword:00000000 +;c 5 Secondary taskbar(s) alignment +;x 0 At screen edge (default) +;x 1 Centered +;x 5 Centered, at screen edge when full +;x 3 Centered with Start button +;x 7 Centered with Start button, at screen edge when full +"MMOldTaskbarAl"=dword:00000000 [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced] ;c 3 Combine taskbar icons on primary taskbar ;x 0 Always combine (default) @@ -151,9 +165,39 @@ ;T Start menu ;y More Start menu options in the Settings app 🡕 ;ms-settings:personalization-start +[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced] +;z 2 Position on screen +;x 0 At screen edge (default) +;x 1 Center +"TaskbarAl"=dword:00000000 +[HKEY_CURRENT_USER\Software\ExplorerPatcher] +;z 22 Maximum number of frequent apps to show +;x 0 None +;x 1 1 +;x 2 2 +;x 3 3 +;x 4 4 +;x 5 5 +;x 6 6 (default) +;x 7 7 +;x 8 8 +;x 9 9 +;x 10 10 +;x 11 11 +;x 12 12 +;x 13 13 +;x 14 14 +;x 15 15 +;x 16 16 +;x 17 17 +;x 18 18 +;x 19 19 +;x 20 20 +;x 99999 Unlimited +;"Virtualized_{D17F1E1A-5919-4427-8F89-A1A8503CA3EB}_Start_MaximumFrequentApps"=dword:00000006 [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StartPage] ;e When using multiple displays, open Start on this monitor when invoked using -;z 10 the keyboard: +;z 10 the keyboard ;x 1 Primary monitor (default) ;x 0 Monitor on which the cursor is on ;x 2 Monitor #2 @@ -165,6 +209,25 @@ ;x 8 Monitor #8 ;x 9 Monitor #9 "MonitorOverride"=dword:00000001 +[HKEY_CURRENT_USER\Software\ExplorerPatcher] +;z 3 Corner preference +;x 1 Rounded corners, floating menu +;x 2 Rounded corners, docked menu +;x 0 Not rounded +;"Virtualized_{D17F1E1A-5919-4427-8F89-A1A8503CA3EB}_StartUI_EnableRoundedCorners"=dword:00000000 +[HKEY_CURRENT_USER\Software\ExplorerPatcher] +;z 3 Display mode +;x 0 Default +;x 1 Start menu +;x 2 Full screen Start +;"Virtualized_{D17F1E1A-5919-4427-8F89-A1A8503CA3EB}_ForceStartSize"=dword:00000000 +;z 3 App list +;x 0 Display +;x 3 Hide +;x 1 Disable +;"Virtualized_{D17F1E1A-5919-4427-8F89-A1A8503CA3EB}_NoStartMenuMorePrograms"=dword:00000000 +;t Some settings might not be available in older Windows 10 versions. + ;T Window switcher [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer] @@ -218,12 +281,6 @@ ;x 2 Dark "ColorScheme"=dword:00000000 [HKEY_CURRENT_USER\Software\ExplorerPatcher\sws] -;c 3 Corner preference -;x 2 Rounded (default) -;x 3 Small rounded -;x 1 Not rounded -"CornerPreference"=dword:00000002 -[HKEY_CURRENT_USER\Software\ExplorerPatcher\sws] ;c 20 Row height ;x 330 330 pt ;x 320 320 pt @@ -299,7 +356,7 @@ ;q ;y Learn more about Simple Window Switcher 🡕 ;https://github.com/valinet/ExplorerPatcher/wiki/Simple-Window-Switcher - +;t Some settings might not be available in older Windows 10 versions. ;T Weather @@ -348,11 +405,6 @@ ;x 1 Light ;x 2 Dark "WeatherTheme"=dword:00000000 -;c 3 Corner preference -;x 2 Rounded (default) -;x 3 Small rounded -;x 1 Not rounded -"WeatherWindowCornerPreference"=dword:00000002 ;q ;t Weather data courtesy of Google, and weather.com. ;y Learn more about the Weather taskbar widget 🡕 diff --git a/ExplorerPatcher/symbols.c b/ExplorerPatcher/symbols.c index 342013a..d31a890 100644 --- a/ExplorerPatcher/symbols.c +++ b/ExplorerPatcher/symbols.c @@ -530,7 +530,7 @@ DWORD DownloadSymbols(DownloadSymbolsParams* params) - if (IsWindows11()) + if (rovi.dwBuildNumber >= 18362) { ZeroMemory(hash, sizeof(WCHAR) * 100); ZeroMemory(wszPath, sizeof(WCHAR) * 100); @@ -1085,7 +1085,8 @@ BOOL LoadSymbols(symbols_addr* symbols_PTRS, HMODULE hModule) if (hKey) RegCloseKey(hKey); } - if (IsWindows11()) + RTL_OSVERSIONINFOW rovi; + if (VnGetOSVersion(&rovi) && rovi.dwBuildNumber >= 18362) { RegCreateKeyExW( HKEY_CURRENT_USER, diff --git a/ep_setup/ep_setup.c b/ep_setup/ep_setup.c index 79d1491..85620ad 100644 --- a/ep_setup/ep_setup.c +++ b/ep_setup/ep_setup.c @@ -423,6 +423,9 @@ int WINAPI wWinMain( _In_ int nShowCmd ) { + RTL_OSVERSIONINFOW rovi; + DWORD32 ubr = VnGetOSVersionAndUBR(&rovi); + BOOL bOk = TRUE, bInstall = TRUE, bWasShellExt = FALSE, bIsUpdate = FALSE, bForcePromptForUninstall = FALSE; SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2); @@ -850,7 +853,7 @@ int WINAPI wWinMain( { bOk = GetWindowsDirectoryW(wszPath, MAX_PATH); } - if (bOk && IsWindows11()) + if (bOk && rovi.dwBuildNumber >= 18362) { wcscat_s(wszPath, MAX_PATH, L"\\SystemApps\\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\\dxgi.dll"); bOk = InstallResource(bInstall, hInstance, IDR_EP_AMD64, wszPath);