diff --git a/SystemInformer/main.c b/SystemInformer/main.c index 67b88a697..e60cdf1f5 100644 --- a/SystemInformer/main.c +++ b/SystemInformer/main.c @@ -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); diff --git a/phlib/theme.c b/phlib/theme.c index b312aafed..385a76bef 100644 --- a/phlib/theme.c +++ b/phlib/theme.c @@ -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); diff --git a/tools/CustomSetupTool/main.c b/tools/CustomSetupTool/main.c index 687832b00..3e97cc70b 100644 --- a/tools/CustomSetupTool/main.c +++ b/tools/CustomSetupTool/main.c @@ -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); } diff --git a/tools/CustomSetupTool/wizard.c b/tools/CustomSetupTool/wizard.c index db987c505..43f5b4ec1 100644 --- a/tools/CustomSetupTool/wizard.c +++ b/tools/CustomSetupTool/wizard.c @@ -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: diff --git a/tools/peview/settings.c b/tools/peview/settings.c index f30e9f294..245a40c21 100644 --- a/tools/peview/settings.c +++ b/tools/peview/settings.c @@ -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");