Browse Source

All: Enable centered taskbar and Start menu options in Windows 10

pull/996/head
Valentin Radu 4 years ago
parent
commit
fb204c7d3c
  1. 10
      ExplorerPatcher/dllmain.c
  2. 78
      ExplorerPatcher/settings10.reg
  3. 5
      ExplorerPatcher/symbols.c
  4. 5
      ep_setup/ep_setup.c

10
ExplorerPatcher/dllmain.c

@ -9589,7 +9589,7 @@ int StartUI_SetWindowRgn(HWND hWnd, HRGN hRgn, BOOL bRedraw)
HRESULT hr = IsThreadCoreWindowVisible(&bIsWindowVisible); HRESULT hr = IsThreadCoreWindowVisible(&bIsWindowVisible);
if (SUCCEEDED(hr)) if (SUCCEEDED(hr))
{ {
ShowWindow(hWnd, bIsWindowVisible ? SW_SHOW : SW_HIDE); if (IsWindows11()) ShowWindow(hWnd, bIsWindowVisible ? SW_SHOW : SW_HIDE);
DWORD TaskbarAl = InterlockedAdd(&dwTaskbarAl, 0); DWORD TaskbarAl = InterlockedAdd(&dwTaskbarAl, 0);
if (bIsWindowVisible && (!TaskbarAl ? StartUI_EnableRoundedCornersApply : 1)) if (bIsWindowVisible && (!TaskbarAl ? StartUI_EnableRoundedCornersApply : 1))
{ {
@ -10125,7 +10125,7 @@ void InjectStartMenu()
StartMenu_LoadSettings(FALSE); StartMenu_LoadSettings(FALSE);
if (dwStartShowClassicMode) if (dwStartShowClassicMode || !IsWindows11())
{ {
LoadLibraryW(L"StartUI.dll"); LoadLibraryW(L"StartUI.dll");
hStartUI = GetModuleHandleW(L"StartUI.dll"); hStartUI = GetModuleHandleW(L"StartUI.dll");
@ -10133,6 +10133,8 @@ void InjectStartMenu()
// Fixes hang when Start menu closes // Fixes hang when Start menu closes
VnPatchDelayIAT(hStartUI, "ext-ms-win-ntuser-draw-l1-1-0.dll", "SetWindowRgn", StartUI_SetWindowRgn); VnPatchDelayIAT(hStartUI, "ext-ms-win-ntuser-draw-l1-1-0.dll", "SetWindowRgn", StartUI_SetWindowRgn);
if (IsWindows11())
{
// Redirects to StartTileData from 22000.51 which works with the legacy menu // Redirects to StartTileData from 22000.51 which works with the legacy menu
LoadLibraryW(L"combase.dll"); LoadLibraryW(L"combase.dll");
HANDLE hCombase = GetModuleHandleW(L"combase.dll"); HANDLE hCombase = GetModuleHandleW(L"combase.dll");
@ -10153,6 +10155,7 @@ void InjectStartMenu()
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", "RegQueryValueExW", StartUI_RegQueryValueExW);
VnPatchIAT(hWindowsCloudStore, "api-ms-win-core-registry-l1-1-0.dll", "RegCloseKey", StartUI_RegCloseKey); VnPatchIAT(hWindowsCloudStore, "api-ms-win-core-registry-l1-1-0.dll", "RegCloseKey", StartUI_RegCloseKey);
} }
}
else else
{ {
LoadLibraryW(L"StartDocked.dll"); LoadLibraryW(L"StartDocked.dll");
@ -10522,11 +10525,8 @@ HRESULT EntryPoint(DWORD dwMethod)
bInstanced = TRUE; bInstanced = TRUE;
} }
else if (bIsThisStartMEH) else if (bIsThisStartMEH)
{
if (IsWindows11())
{ {
InjectStartMenu(); InjectStartMenu();
}
IncrementDLLReferenceCount(hModule); IncrementDLLReferenceCount(hModule);
bInstanced = TRUE; bInstanced = TRUE;
} }

78
ExplorerPatcher/settings10.reg

@ -48,6 +48,20 @@
;x 0 Windows 10 (default) ;x 0 Windows 10 (default)
;x 1 Windows 11 ;x 1 Windows 11
"OrbStyle"=dword:00000000 "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] [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
;c 3 Combine taskbar icons on primary taskbar ;c 3 Combine taskbar icons on primary taskbar
;x 0 Always combine (default) ;x 0 Always combine (default)
@ -151,9 +165,39 @@
;T Start menu ;T Start menu
;y More Start menu options in the Settings app 🡕 ;y More Start menu options in the Settings app 🡕
;ms-settings:personalization-start ;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] [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StartPage]
;e When using multiple displays, open Start on this monitor when invoked using ;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 1 Primary monitor (default)
;x 0 Monitor on which the cursor is on ;x 0 Monitor on which the cursor is on
;x 2 Monitor #2 ;x 2 Monitor #2
@ -165,6 +209,25 @@
;x 8 Monitor #8 ;x 8 Monitor #8
;x 9 Monitor #9 ;x 9 Monitor #9
"MonitorOverride"=dword:00000001 "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 ;T Window switcher
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer] [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer]
@ -218,12 +281,6 @@
;x 2 Dark ;x 2 Dark
"ColorScheme"=dword:00000000 "ColorScheme"=dword:00000000
[HKEY_CURRENT_USER\Software\ExplorerPatcher\sws] [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 ;c 20 Row height
;x 330 330 pt ;x 330 330 pt
;x 320 320 pt ;x 320 320 pt
@ -299,7 +356,7 @@
;q ;q
;y Learn more about Simple Window Switcher 🡕 ;y Learn more about Simple Window Switcher 🡕
;https://github.com/valinet/ExplorerPatcher/wiki/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 ;T Weather
@ -348,11 +405,6 @@
;x 1 Light ;x 1 Light
;x 2 Dark ;x 2 Dark
"WeatherTheme"=dword:00000000 "WeatherTheme"=dword:00000000
;c 3 Corner preference
;x 2 Rounded (default)
;x 3 Small rounded
;x 1 Not rounded
"WeatherWindowCornerPreference"=dword:00000002
;q ;q
;t Weather data courtesy of Google, and weather.com. ;t Weather data courtesy of Google, and weather.com.
;y Learn more about the Weather taskbar widget 🡕 ;y Learn more about the Weather taskbar widget 🡕

5
ExplorerPatcher/symbols.c

@ -530,7 +530,7 @@ DWORD DownloadSymbols(DownloadSymbolsParams* params)
if (IsWindows11()) if (rovi.dwBuildNumber >= 18362)
{ {
ZeroMemory(hash, sizeof(WCHAR) * 100); ZeroMemory(hash, sizeof(WCHAR) * 100);
ZeroMemory(wszPath, 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 (hKey) RegCloseKey(hKey);
} }
if (IsWindows11()) RTL_OSVERSIONINFOW rovi;
if (VnGetOSVersion(&rovi) && rovi.dwBuildNumber >= 18362)
{ {
RegCreateKeyExW( RegCreateKeyExW(
HKEY_CURRENT_USER, HKEY_CURRENT_USER,

5
ep_setup/ep_setup.c

@ -423,6 +423,9 @@ int WINAPI wWinMain(
_In_ int nShowCmd _In_ int nShowCmd
) )
{ {
RTL_OSVERSIONINFOW rovi;
DWORD32 ubr = VnGetOSVersionAndUBR(&rovi);
BOOL bOk = TRUE, bInstall = TRUE, bWasShellExt = FALSE, bIsUpdate = FALSE, bForcePromptForUninstall = FALSE; BOOL bOk = TRUE, bInstall = TRUE, bWasShellExt = FALSE, bIsUpdate = FALSE, bForcePromptForUninstall = FALSE;
SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2); SetProcessDpiAwarenessContext(DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2);
@ -850,7 +853,7 @@ int WINAPI wWinMain(
{ {
bOk = GetWindowsDirectoryW(wszPath, MAX_PATH); 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"); wcscat_s(wszPath, MAX_PATH, L"\\SystemApps\\Microsoft.Windows.StartMenuExperienceHost_cw5n1h2txyewy\\dxgi.dll");
bOk = InstallResource(bInstall, hInstance, IDR_EP_AMD64, wszPath); bOk = InstallResource(bInstall, hInstance, IDR_EP_AMD64, wszPath);

Loading…
Cancel
Save