From b9c45805510801a9ac95e217c4a50dbc46844c1e Mon Sep 17 00:00:00 2001 From: Anixx Date: Mon, 8 Dec 2025 20:00:19 +0200 Subject: [PATCH 1/4] Support for unthemed taskbar See this discussion: https://github.com/Open-Shell/Open-Shell-Menu/discussions/2367 --- Src/StartMenu/StartMenuDLL/StartMenuDLL.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Src/StartMenu/StartMenuDLL/StartMenuDLL.cpp b/Src/StartMenu/StartMenuDLL/StartMenuDLL.cpp index 9f26f2284..ea1779bcb 100644 --- a/Src/StartMenu/StartMenuDLL/StartMenuDLL.cpp +++ b/Src/StartMenu/StartMenuDLL/StartMenuDLL.cpp @@ -1872,6 +1872,7 @@ static LRESULT CALLBACK SubclassTaskBarProc( HWND hWnd, UINT uMsg, WPARAM wParam ComputeTaskbarColors(data); WINCOMPATTRDATA attrData={0x13,&data,sizeof(data)}; SetWindowCompositionAttribute(hWnd,&attrData); + if(!IsAppThemed()) {UpdateTaskBars(TASKBAR_UPDATE_TEXTURE);} return res; } if ((uMsg==WM_DWMCOLORIZATIONCOLORCHANGED || uMsg==WM_SETTINGCHANGE) && taskBar && taskBar->bCustomLook && SetWindowCompositionAttribute && GetWinVersion()WIN_VER_WIN7) - { - color=GetSystemGlassColor8(); - color=((color&0xFF)<<16)|(color&0xFF00)|((color>>16)&0xFF); - } + color=GetSysColor(COLOR_BTNFACE); BITMAPINFO bi={0}; bi.bmiHeader.biSize=sizeof(BITMAPINFOHEADER); bi.bmiHeader.biWidth=bi.bmiHeader.biHeight=32; @@ -3012,7 +3009,10 @@ static void InitStartMenuDLL( void ) if (GetWinVersion()<=WIN_VER_WIN81) g_DrawThemeBackgroundHook=SetIatHook(module,"uxtheme.dll","DrawThemeBackground",DrawThemeBackground2); g_DrawThemeTextHook=SetIatHook(module,"uxtheme.dll","DrawThemeText",DrawThemeText2); - g_DrawThemeTextExHook=SetIatHook(module,"uxtheme.dll","DrawThemeTextEx",DrawThemeTextEx2); + if (IsAppThemed()) + { + g_DrawThemeTextExHook=SetIatHook(module,"uxtheme.dll","DrawThemeTextEx",DrawThemeTextEx2); + } g_DrawThemeTextCtlHook=SetIatHook(GetModuleHandle(L"comctl32.dll"),"uxtheme.dll","DrawThemeText",DrawThemeText2); if (GetWinVersion()>=WIN_VER_WIN10) g_SetWindowCompositionAttributeHook=SetIatHook(module,"user32.dll","SetWindowCompositionAttribute",SetWindowCompositionAttribute2); From bf043a9767d7683aa4963804e9bc1f12c53fb8e9 Mon Sep 17 00:00:00 2001 From: Anixx Date: Tue, 9 Dec 2025 06:16:41 +0200 Subject: [PATCH 2/4] Refactor color handling in StartMenuDLL --- Src/StartMenu/StartMenuDLL/StartMenuDLL.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Src/StartMenu/StartMenuDLL/StartMenuDLL.cpp b/Src/StartMenu/StartMenuDLL/StartMenuDLL.cpp index ea1779bcb..cbbff3bcf 100644 --- a/Src/StartMenu/StartMenuDLL/StartMenuDLL.cpp +++ b/Src/StartMenu/StartMenuDLL/StartMenuDLL.cpp @@ -1872,7 +1872,7 @@ static LRESULT CALLBACK SubclassTaskBarProc( HWND hWnd, UINT uMsg, WPARAM wParam ComputeTaskbarColors(data); WINCOMPATTRDATA attrData={0x13,&data,sizeof(data)}; SetWindowCompositionAttribute(hWnd,&attrData); - if(!IsAppThemed()) {UpdateTaskBars(TASKBAR_UPDATE_TEXTURE);} + UpdateTaskBars(TASKBAR_UPDATE_TEXTURE); return res; } if ((uMsg==WM_DWMCOLORIZATIONCOLORCHANGED || uMsg==WM_SETTINGCHANGE) && taskBar && taskBar->bCustomLook && SetWindowCompositionAttribute && GetWinVersion()WIN_VER_WIN7) + { + if (IsAppThemed()) + { + color=GetSystemGlassColor8(); + color=((color&0xFF)<<16)|(color&0xFF00)|((color>>16)&0xFF); + } else { + color=GetSysColor(COLOR_BTNFACE); + } + } BITMAPINFO bi={0}; bi.bmiHeader.biSize=sizeof(BITMAPINFOHEADER); bi.bmiHeader.biWidth=bi.bmiHeader.biHeight=32; From 4d9ba0cddf47f0c4c845b1b38b2646b5168b4af5 Mon Sep 17 00:00:00 2001 From: ge0rdi Date: Tue, 9 Dec 2025 09:06:23 +0100 Subject: [PATCH 3/4] fix --- Src/StartMenu/StartMenuDLL/StartMenuDLL.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Src/StartMenu/StartMenuDLL/StartMenuDLL.cpp b/Src/StartMenu/StartMenuDLL/StartMenuDLL.cpp index cbbff3bcf..540ab9677 100644 --- a/Src/StartMenu/StartMenuDLL/StartMenuDLL.cpp +++ b/Src/StartMenu/StartMenuDLL/StartMenuDLL.cpp @@ -2384,7 +2384,7 @@ void UpdateTaskBars( TUpdateTaskbar update ) } } } - else + else if ((GetWinVersion()WIN_VER_WIN7) { @@ -2392,7 +2392,9 @@ void UpdateTaskBars( TUpdateTaskbar update ) { color=GetSystemGlassColor8(); color=((color&0xFF)<<16)|(color&0xFF00)|((color>>16)&0xFF); - } else { + } + else + { color=GetSysColor(COLOR_BTNFACE); } } From 632ecf7c3b73576347941f3d7f28fd60a282cfb3 Mon Sep 17 00:00:00 2001 From: ge0rdi Date: Tue, 9 Dec 2025 12:03:19 +0100 Subject: [PATCH 4/4] fix --- Src/StartMenu/StartMenuDLL/StartMenuDLL.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/StartMenu/StartMenuDLL/StartMenuDLL.cpp b/Src/StartMenu/StartMenuDLL/StartMenuDLL.cpp index 540ab9677..9111cb40c 100644 --- a/Src/StartMenu/StartMenuDLL/StartMenuDLL.cpp +++ b/Src/StartMenu/StartMenuDLL/StartMenuDLL.cpp @@ -1624,7 +1624,7 @@ static void ComputeTaskbarColors( int *data ) { bool bDefLook; int look=GetSettingInt(L"TaskbarLook",bDefLook); - if (GetWinVersion()