Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PhReInitializeTheme: runtime theme switching on ImmersiveColorSet message #2284

Open
wants to merge 46 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
d7c9146
Moved delayhook to phlib
DartVanya Nov 17, 2024
41e2bb4
Merge branch 'master' into master-dm
DartVanya Nov 18, 2024
f754e7b
objmgr cleanup and fixes
DartVanya Nov 18, 2024
5c82999
memsrcht show memory editor on double click
DartVanya Nov 18, 2024
a8177bc
Improve PhUiCloseHandles for protected handles
DartVanya Nov 18, 2024
c7ee979
theme custom colors cleanup
DartVanya Nov 18, 2024
9fa8c81
objmgr cleanup and improvements
DartVanya Nov 20, 2024
1b8c82a
Merge branch 'master' into master-dm
DartVanya Nov 20, 2024
b297c03
fix PhIsThemeTransparencyEnabled
DartVanya Nov 20, 2024
4aa8cab
PhReInitializeTheme: runtime theme switching on ImmersiveColorSet mes…
DartVanya Nov 22, 2024
53fe931
Merge branch 'master' into master-dm
DartVanya Nov 22, 2024
165f3a5
fix #2074
DartVanya Nov 22, 2024
b23b560
remove objmgr code
DartVanya Nov 23, 2024
114546f
Merge branch 'master' into master-dm
DartVanya Nov 23, 2024
f43888b
fix combo bug and cleanup indents
DartVanya Nov 23, 2024
64b39b8
move a8177bc4acb7c3da02d61e9c74d3c62db4da3580 to objmgr branch
DartVanya Nov 26, 2024
097d175
Merge branch 'winsiderss:master' into master-dm
DartVanya Nov 26, 2024
30442be
Merge branch 'master' into master-dm
DartVanya Nov 26, 2024
68e0704
moved hndlmenu to objmgr branch
DartVanya Nov 26, 2024
72e8930
fix SysLink color in TaskDialog on Windows 10
DartVanya Nov 28, 2024
5b0d7a9
Merge branch 'master' into master-dm
DartVanya Nov 28, 2024
b2d0b61
Merge branch 'master' into master-dm
DartVanya Nov 28, 2024
25bf4ff
Merge branch 'master' into master-dm
DartVanya Nov 29, 2024
db6ddb6
Merge branch 'master' into master-dm
DartVanya Dec 3, 2024
e4f0436
resolve conflicts and general cleanup
DartVanya Dec 3, 2024
b9752a8
Merge branch 'master' into master-dm
DartVanya Dec 3, 2024
791f590
Transition to IListView
DartVanya Dec 4, 2024
b9ac48c
hndlprp.h
DartVanya Dec 4, 2024
0919898
WindowExplorer auto refresh on find
DartVanya Dec 4, 2024
318e6a8
Merge branch 'master' into master-dm
DartVanya Dec 5, 2024
3f57779
Merge branch 'master' into master-dm
DartVanya Dec 5, 2024
309a514
fix PhOpenDriver regression from 95bc2fe8c1a077aeb2103c076e3991683294…
DartVanya Dec 5, 2024
64bc003
Merge branch 'master-temp' into master-dm
DartVanya Dec 5, 2024
ebac1fa
Improve streamer mode for ComboBox and ToolTips
DartVanya Dec 5, 2024
2348d01
Merge branch 'master' into master-dm
DartVanya Dec 9, 2024
2a49e11
Merge branch 'master' into master-dm
DartVanya Dec 10, 2024
5a58e99
Merge branch 'master' into master-dm
DartVanya Dec 10, 2024
69e87b9
delayhook automatic tooltip theme
DartVanya Dec 11, 2024
dfd11b5
fix graph automatic theme switching
DartVanya Dec 12, 2024
dafd8fc
graph fix new colors in dark theme
DartVanya Dec 12, 2024
3971519
[test] graph old colors - use theme colors for background and grid
DartVanya Dec 12, 2024
e4210cb
chcol ListBox fix dynamic theme switching
DartVanya Dec 17, 2024
edf884f
improve ListView group header drawing
DartVanya Dec 18, 2024
0c07b10
Merge branch 'master' into master-dm
DartVanya Jan 28, 2025
280a677
Merge branch 'master' into master-dm
DartVanya Jan 28, 2025
86deb75
objprp ListView indexes cleanup
DartVanya Jan 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion SystemInformer/SystemInformer.def
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ EXPORTS
PhWritePhTextHeader
PhaChoiceDialog
PhaGetProcessKnownCommandLine
PhCreateHandleItem
PhShowHandlePropertiesEx

; plugin
PhEnumeratePlugins
Expand Down Expand Up @@ -808,6 +810,7 @@ EXPORTS
; cpysave
PhGetGenericTreeNewLines
PhGetListViewItemText
PhGetIListViewItemText
PhGetListViewSelectedItemText
PhGetTreeNewText

Expand Down Expand Up @@ -885,13 +888,15 @@ EXPORTS
PhFindIListViewItemByFlags
PhFindListViewItemByFlags
PhFindListViewItemByParam
PhFindIListViewItemByParam
PhGetComboBoxString
PhGetDialogItemValue
PhGetIListViewItemParam
PhGetListBoxString
PhGetListViewItemImageIndex
PhGetListViewItemParam
PhGetSelectedListViewItemParam
PhGetSelectedIListViewItemParam
PhGetSelectedListViewItemParams
PhGetSelectedIListViewItemParams
PhGetStockApplicationIcon
Expand Down Expand Up @@ -920,9 +925,10 @@ EXPORTS
PhModalPropertySheet
PhQueryDirectXExclusiveOwnership
PhInitializeWindowTheme
PhReInitializeWindowTheme
PhReInitializeTheme
PhRegisterWindowCallback
PhRemoveListViewItem
PhRemoveIListViewItem
PhRemoveWindowContext
PhSelectComboBoxString
PhSetClipboardString
Expand All @@ -934,16 +940,21 @@ EXPORTS
PhSetHeaderSortIcon
PhSetImageListBitmap
PhSetListViewItemImageIndex
PhSetIListViewItemImageIndex
PhSetListViewItemParam
PhSetListViewSubItem
PhSetIListViewSubItem
PhSetStateAllListViewItems
PhSetWindowContext
PhSetWindowText
PhThemeWindowDrawButton
PhThemeWindowDrawRebar
PhThemeWindowDrawToolbar
PhUnregisterWindowCallback
PhWindowThemeControlColor
PhIsThemeSupportEnabled
PhWindowThemeSetDarkMode
PhReInitializeStreamerMode

; hndlinfo
PhCallKphQueryFileInformationWithTimeout
Expand Down
2,182 changes: 1,097 additions & 1,085 deletions SystemInformer/SystemInformer.def.h

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions SystemInformer/SystemInformer.rc
Original file line number Diff line number Diff line change
Expand Up @@ -1424,9 +1424,9 @@ BEGIN
DEFPUSHBUTTON "OK",IDOK,62,82,50,14
PUSHBUTTON "Cancel",IDCANCEL,116,82,50,14
PUSHBUTTON "&Browse...",IDC_BROWSE,170,82,50,14
CONTROL "Create this task with TrustedInstaller privileges.",IDC_TRUSTEDINSTALLER,
CONTROL "Create this task with &TrustedInstaller privileges.",IDC_TRUSTEDINSTALLER,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,40,62,180,10
CONTROL "Create this task with Administrative privileges.",IDC_TOGGLEELEVATION,
CONTROL "Create this task with &Administrative privileges.",IDC_TOGGLEELEVATION,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,40,51,180,10
END

Expand Down
2 changes: 1 addition & 1 deletion SystemInformer/SystemInformer.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,6 @@
<ClCompile Include="colmgr.c" />
<ClCompile Include="colsetmgr.c" />
<ClCompile Include="dbgcon.c" />
<ClCompile Include="delayhook.c" />
<ClCompile Include="delayload.c" />
<ClCompile Include="devprv.c" />
<ClCompile Include="extmgr.c" />
Expand Down Expand Up @@ -503,6 +502,7 @@
<ClInclude Include="include\heapstruct.h" />
<ClInclude Include="include\hndllist.h" />
<ClInclude Include="include\hndlmenu.h" />
<ClInclude Include="include\hndlprp.h" />
<ClInclude Include="include\hndlprv.h" />
<ClInclude Include="include\informer.h" />
<ClInclude Include="include\ksisup.h" />
Expand Down
6 changes: 3 additions & 3 deletions SystemInformer/SystemInformer.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,6 @@
<ClCompile Include="ksisup.c">
<Filter>System Informer</Filter>
</ClCompile>
<ClCompile Include="delayhook.c">
<Filter>System Informer</Filter>
</ClCompile>
<ClCompile Include="ksyscall.c">
<Filter>System Informer</Filter>
</ClCompile>
Expand Down Expand Up @@ -500,6 +497,9 @@
<ClInclude Include="include\informer.h">
<Filter>Headers</Filter>
</ClInclude>
<ClInclude Include="include\hndlprp.h">
<Filter>Headers</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="SystemInformer.ico">
Expand Down
2 changes: 1 addition & 1 deletion SystemInformer/about.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ static INT_PTR CALLBACK PhpAboutDlgProc(
PhSetDialogFocus(hwndDlg, GetDlgItem(hwndDlg, IDOK));
PhRegisterWindowCallback(hwndDlg, PH_PLUGIN_WINDOW_EVENT_TYPE_TOPMOST, NULL);

PhInitializeWindowTheme(hwndDlg, PhEnableThemeSupport);
PhInitializeWindowTheme(hwndDlg);
}
break;
case WM_DESTROY:
Expand Down
2 changes: 0 additions & 2 deletions SystemInformer/actions.c
Original file line number Diff line number Diff line change
Expand Up @@ -3996,8 +3996,6 @@ HRESULT CALLBACK PhpUiServiceInitializeDialogCallbackProc(
{
PhShowServiceProgressDialogStatusPage(context);
}

PhInitializeWindowTheme(WindowHandle, !!PhGetIntegerSetting(L"EnableThemeSupport"));
}
break;
}
Expand Down
2 changes: 1 addition & 1 deletion SystemInformer/affinity.c
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ INT_PTR CALLBACK PhpProcessAffinityDlgProc(
}
}

PhInitializeWindowTheme(hwndDlg, PhEnableThemeSupport);
PhInitializeWindowTheme(hwndDlg);
}
break;
case WM_DESTROY:
Expand Down
42 changes: 23 additions & 19 deletions SystemInformer/chcol.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ typedef struct _COLUMNS_DIALOG_CONTEXT
HBRUSH BrushPushed;
HBRUSH BrushHot;
COLORREF TextColor;
HBRUSH BrushNormalDark;
HBRUSH BrushPushedDark;
HBRUSH BrushHotDark;
COLORREF TextColorDark;

HWND InactiveWindowHandle;
HWND ActiveWindowHandle;
Expand Down Expand Up @@ -256,20 +260,15 @@ INT_PTR CALLBACK PhpColumnsDlgProc(
Button_Enable(context->MoveUpHandle, FALSE);
Button_Enable(context->MoveDownHandle, FALSE);

if (PhEnableThemeSupport)
{
context->BrushNormal = CreateSolidBrush(PhThemeWindowBackgroundColor);
context->BrushHot = CreateSolidBrush(PhThemeWindowHighlightColor);
context->BrushPushed = CreateSolidBrush(PhThemeWindowHighlight2Color);
context->TextColor = PhThemeWindowTextColor;
}
else
{
context->BrushNormal = GetSysColorBrush(COLOR_WINDOW);
context->BrushHot = CreateSolidBrush(RGB(145, 201, 247));
context->BrushPushed = CreateSolidBrush(RGB(153, 209, 255));
context->TextColor = GetSysColor(COLOR_WINDOWTEXT);
}
context->BrushNormal = GetSysColorBrush(COLOR_WINDOW);
context->BrushHot = CreateSolidBrush(RGB(145, 201, 247));
context->BrushPushed = CreateSolidBrush(RGB(153, 209, 255));
context->TextColor = GetSysColor(COLOR_WINDOWTEXT);

context->BrushNormalDark = CreateSolidBrush(PhThemeWindowBackgroundColor);
context->BrushHotDark = CreateSolidBrush(PhThemeWindowHighlightColor);
context->BrushPushedDark = CreateSolidBrush(PhThemeWindowHighlight2Color);
context->TextColorDark = PhThemeWindowTextColor;

if (context->Type == PH_CONTROL_TYPE_TREE_NEW)
{
Expand Down Expand Up @@ -340,7 +339,7 @@ INT_PTR CALLBACK PhpColumnsDlgProc(
SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_INACTIVE, LBN_SELCHANGE), (LPARAM)context->InactiveWindowHandle);
SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_ACTIVE, LBN_SELCHANGE), (LPARAM)context->ActiveWindowHandle);

PhInitializeWindowTheme(hwndDlg, PhEnableThemeSupport);
PhInitializeWindowTheme(hwndDlg);

PhSetDialogFocus(hwndDlg, GetDlgItem(hwndDlg, IDCANCEL));
}
Expand All @@ -356,6 +355,12 @@ INT_PTR CALLBACK PhpColumnsDlgProc(
DeleteBrush(context->BrushHot);
if (context->BrushPushed)
DeleteBrush(context->BrushPushed);
if (context->BrushNormalDark)
DeleteBrush(context->BrushNormalDark);
if (context->BrushHotDark)
DeleteBrush(context->BrushHotDark);
if (context->BrushPushedDark)
DeleteBrush(context->BrushPushedDark);
if (context->ControlFont)
DeleteFont(context->ControlFont);
if (context->InactiveListArray)
Expand Down Expand Up @@ -696,16 +701,15 @@ INT_PTR CALLBACK PhpColumnsDlgProc(

if (isSelected || isFocused)
{
FillRect(bufferDc, &bufferRect, context->BrushHot);
FillRect(bufferDc, &bufferRect, PhEnableThemeSupport ? context->BrushHotDark : context->BrushHot);
//FrameRect(bufferDc, &bufferRect, PhGetStockBrush(BLACK_BRUSH));
SetTextColor(bufferDc, context->TextColor);
}
else
{
FillRect(bufferDc, &bufferRect, context->BrushNormal);
FillRect(bufferDc, &bufferRect, PhEnableThemeSupport ? context->BrushNormalDark : context->BrushNormal);
//FrameRect(bufferDc, &bufferRect, GetSysColorBrush(COLOR_HIGHLIGHTTEXT));
SetTextColor(bufferDc, context->TextColor);
}
SetTextColor(bufferDc, PhEnableThemeSupport ? context->TextColorDark : context->TextColor);

bufferRect.left += 5;
DrawText(
Expand Down
13 changes: 8 additions & 5 deletions SystemInformer/chdlg.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ INT_PTR CALLBACK PhChoiceDlgProc(
SWP_NOACTIVATE | SWP_NOZORDER);
}

PhInitializeWindowTheme(WindowHandle, PhEnableThemeSupport);
PhInitializeWindowTheme(WindowHandle);

PhSetDialogFocus(WindowHandle, comboBoxHandle);
}
Expand Down Expand Up @@ -430,9 +430,12 @@ INT_PTR CALLBACK PhChooseNewPageDlgProc(

PhSetDialogFocus(WindowHandle, context->ComboBoxHandle);

if (PhEnableThemeSupport)
ShowWindow(GetDlgItem(WindowHandle, IDC_SIZE_), SW_HIDE);
PhInitializeWindowTheme(WindowHandle, PhEnableThemeSupport);
PhInitializeWindowTheme(WindowHandle);
}
break;
case WM_THEMECHANGED:
{
ShowWindow(GetDlgItem(WindowHandle, IDC_SIZE_), PhEnableThemeSupport ? SW_HIDE : SW_SHOW);
}
break;
case WM_DESTROY:
Expand Down Expand Up @@ -541,7 +544,7 @@ INT_PTR CALLBACK PhChooseNewPageDlgProc(

if (PhEnableThemeSupport)
{
SetDCBrushColor(hdc, RGB(50, 50, 50));
SetDCBrushColor(hdc, PhMakeColorBrighter(PhThemeWindowBackgroundColor, 7)); // RGB(50, 50, 50)
FillRect(hdc, &clientRect, PhGetStockBrush(DC_BRUSH));
clientRect.bottom = clientRect.top + 1;
SetDCBrushColor(hdc, PhThemeWindowForegroundColor);
Expand Down
2 changes: 1 addition & 1 deletion SystemInformer/chproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ INT_PTR CALLBACK PhpChooseProcessDlgProc(

EnableWindow(GetDlgItem(hwndDlg, IDOK), FALSE);

PhInitializeWindowTheme(hwndDlg, PhEnableThemeSupport);
PhInitializeWindowTheme(hwndDlg);
}
break;
case WM_DESTROY:
Expand Down
2 changes: 1 addition & 1 deletion SystemInformer/colsetmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ INT_PTR CALLBACK PhpColumnSetEditorDlgProc(
Button_Enable(context->MoveDownButtonHandle, FALSE);
Button_Enable(context->RemoveButtonHandle, FALSE);

PhInitializeWindowTheme(hwndDlg, PhEnableThemeSupport);
PhInitializeWindowTheme(hwndDlg);
}
break;
case WM_DESTROY:
Expand Down
2 changes: 1 addition & 1 deletion SystemInformer/findobj.c
Original file line number Diff line number Diff line change
Expand Up @@ -1251,7 +1251,7 @@ INT_PTR CALLBACK PhFindObjectsDlgProc(

Edit_SetSel(context->SearchWindowHandle, 0, -1);

PhInitializeWindowTheme(hwndDlg, PhEnableThemeSupport);
PhInitializeWindowTheme(hwndDlg);
}
break;
case WM_DESTROY:
Expand Down
2 changes: 1 addition & 1 deletion SystemInformer/gdihndl.c
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ INT_PTR CALLBACK PhpGdiHandlesDlgProc(

PhpRefreshGdiHandles(context);

PhInitializeWindowTheme(hwndDlg, PhEnableThemeSupport);
PhInitializeWindowTheme(hwndDlg);
}
break;
case WM_DESTROY:
Expand Down
2 changes: 1 addition & 1 deletion SystemInformer/heapinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ INT_PTR CALLBACK PhpProcessHeapsDlgProc(
else
PhCenterWindow(hwndDlg, context->ParentWindowHandle);

PhInitializeWindowTheme(hwndDlg, PhEnableThemeSupport);
PhInitializeWindowTheme(hwndDlg);
}
break;
case WM_DESTROY:
Expand Down
2 changes: 1 addition & 1 deletion SystemInformer/hidnproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ INT_PTR CALLBACK PhpZombieProcessesDlgProc(

EnableWindow(GetDlgItem(hwndDlg, IDC_TERMINATE), FALSE);

PhInitializeWindowTheme(hwndDlg, PhEnableThemeSupport);
PhInitializeWindowTheme(hwndDlg);
}
break;
case WM_DESTROY:
Expand Down
Loading