Fix win11 border and update wizard (#2968)

This commit is contained in:
NotEnsoul
2026-07-12 07:40:41 +02:00
committed by GitHub
parent 9ef1c3f5ca
commit 568fa6736e
5 changed files with 47 additions and 8 deletions
+1
View File
@@ -1558,6 +1558,7 @@ VOID PhInitializeAppSettings(
PhEnableHighResolution = WindowsVersion >= WINDOWS_11 && PhGetIntegerSetting(SETTING_ENABLE_HIGH_RESOLUTION);
PhEnableThemeSupport = !!PhGetIntegerSetting(SETTING_ENABLE_THEME_SUPPORT);
PhEnableWindowBorderColor = !!PhGetIntegerSetting(SETTING_ENABLE_WINDOW_BORDER_COLOR);
PhThemeWindowForegroundColor = PhGetIntegerSetting(SETTING_THEME_WINDOW_FOREGROUND_COLOR);
PhThemeWindowBackgroundColor = PhGetIntegerSetting(SETTING_THEME_WINDOW_BACKGROUND_COLOR);
PhThemeWindowBackground2Color = PhGetIntegerSetting(SETTING_THEME_WINDOW_BACKGROUND2_COLOR);
+4 -1
View File
@@ -1373,7 +1373,11 @@ COLORREF PhGetWindowBorderColor(
)
{
if (!PhEnableWindowBorderColor)
{
if (WindowsVersion >= WINDOWS_11)
return DWMWA_COLOR_DEFAULT;
return 0;
}
if (IsHandleFiltered)
return PhpWindowThemeCurrentPalette.FilteredBorderColor;
@@ -3363,7 +3367,6 @@ LRESULT CALLBACK PhpThemeWindowSubclassProc(
return result;
}
break;
}
return CallWindowProc(oldWndProc, hWnd, uMsg, wParam, lParam);
+35 -4
View File
@@ -91,9 +91,7 @@ LRESULT CALLBACK SetupTaskDialogSubclassProc(
{
//ShowUpdateCompletedPageDialog(context);
SetupExecuteApplication(context);
PostMessage(context->DialogHandle, TDM_CLICK_BUTTON, IDOK, 0);
PostMessage(context->DialogHandle, TDM_CLICK_BUTTON, IDCANCEL, 0);
}
break;
case SETUP_SHOWUPDATEERROR:
@@ -610,7 +608,40 @@ INT WINAPI wWinMain(
SetupParseCommandLine(context);
SetupInitializeShortcutOptions(context);
if (context->Silent)
if (!context->Silent && context->SetupMode == SetupCommandUpdate && !PhGetOwnTokenAttributes().Elevated)
{
NTSTATUS status = STATUS_FAIL_CHECK;
PPH_STRING applicationFileName;
PH_STRINGREF applicationCommandLineStringRef;
if (NT_SUCCESS(PhGetProcessCommandLineStringRef(&applicationCommandLineStringRef)))
{
if (applicationFileName = PhGetApplicationFileNameWin32())
{
PPH_STRING applicationCommandLine = PhCreateString2(&applicationCommandLineStringRef);
status = PhShellExecuteEx(
NULL,
PhGetString(applicationFileName),
PhGetString(applicationCommandLine),
NULL,
SW_SHOW,
PH_SHELL_EXECUTE_ADMIN,
0,
&context->SubProcessHandle
);
PhDereferenceObject(applicationCommandLine);
PhDereferenceObject(applicationFileName);
}
}
if (!NT_SUCCESS(status))
{
context->LastStatus = status;
}
}
else if (context->Silent)
{
SetupSilent(context);
}
+5 -3
View File
@@ -141,7 +141,10 @@ VOID SetupUpdateWindowBorderColor(
if (!SetupWizardDarkMode || !SetupDwmSetWindowAttribute_I)
return;
borderColor = Active ? GetSysColor(COLOR_HOTLIGHT) : SetupWizardColorWindowInactiveBorder;
if (WindowsVersion >= WINDOWS_11)
borderColor = 0xffffffff; // DWMWA_COLOR_DEFAULT
else
borderColor = Active ? GetSysColor(COLOR_HOTLIGHT) : SetupWizardColorWindowInactiveBorder;
SetupDwmSetWindowAttribute_I(WindowHandle, SETUP_DWM_BORDER_COLOR, &borderColor, sizeof(borderColor));
}
@@ -1934,8 +1937,7 @@ INT_PTR CALLBACK SetupInstallPageDlgProc(
break;
case SETUP_SHOWUPDATEFINAL:
{
SetupExecuteApplication(context);
PropSheet_PressButton(context->ParentWindowHandle, PSBTN_FINISH);
PropSheet_SetCurSel(context->ParentWindowHandle, NULL, SETUP_WIZARD_COMPLETED_PAGE_INDEX);
}
break;
case SETUP_SHOWUNINSTALLFINAL:
+2
View File
@@ -29,6 +29,7 @@ VOID PvAddDefaultSettings(
PhpAddIntegerSetting(L"EnableThemeAcrylicWindowSupport", L"0");
PhpAddIntegerSetting(L"EnableThemeAnimation", L"1");
PhpAddIntegerSetting(L"EnableThemeNativeButtons", L"0");
PhpAddIntegerSetting(L"EnableWindowBorderColor", L"1");
PhpAddIntegerSetting(L"ThemeWindowForegroundColor", L"1c1c1c"); // RGB(28, 28, 28)
PhpAddIntegerSetting(L"ThemeWindowBackgroundColor", L"2b2b2b"); // RGB(43, 43, 43)
PhpAddIntegerSetting(L"ThemeWindowBackground2Color", L"414141"); // RGB(65, 65, 65)
@@ -123,6 +124,7 @@ VOID PvUpdateCachedSettings(
PhMaxSizeUnit = PhGetIntegerSetting(L"MaxSizeUnit");
PhEnableSecurityAdvancedDialog = !!PhGetIntegerSetting(L"EnableSecurityAdvancedDialog");
PhEnableThemeSupport = !!PhGetIntegerSetting(L"EnableThemeSupport");
PhEnableWindowBorderColor = !!PhGetIntegerSetting(L"EnableWindowBorderColor");
PhThemeWindowForegroundColor = PhGetIntegerSetting(L"ThemeWindowForegroundColor");
PhThemeWindowBackgroundColor = PhGetIntegerSetting(L"ThemeWindowBackgroundColor");
PhThemeWindowBackground2Color = PhGetIntegerSetting(L"ThemeWindowBackground2Color");