@@ -2039,6 +2039,21 @@ static LRESULT CALLBACK SubclassTaskBarProc( HWND hWnd, UINT uMsg, WPARAM wParam
2039
2039
2040
2040
static LRESULT CALLBACK SubclassTaskListProc ( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData )
2041
2041
{
2042
+ if (uMsg==WM_PAINT && g_TaskbarTexture)
2043
+ {
2044
+ wchar_t name[100 ];
2045
+ GetClassName (hWnd,name,_countof (name));
2046
+ if (_wcsicmp (name,L" MSTaskSwWClass" )==0 )
2047
+ {
2048
+ // draw taskbar background (behind task list)
2049
+ PAINTSTRUCT ps;
2050
+ HDC hdc=BeginPaint (hWnd,&ps);
2051
+ DrawThemeParentBackground (hWnd,hdc,NULL );
2052
+ EndPaint (hWnd,&ps);
2053
+ return 0 ;
2054
+ }
2055
+ }
2056
+
2042
2057
if (uMsg==WM_PAINT || uMsg==WM_PRINT || uMsg==WM_PRINTCLIENT)
2043
2058
{
2044
2059
g_CurrentTaskList=hWnd;
@@ -2880,6 +2895,10 @@ static void InitStartMenuDLL( void )
2880
2895
2881
2896
if (GetSettingBool (L" CustomTaskbar" ))
2882
2897
{
2898
+ auto module =GetModuleHandle (L" taskbar.dll" );
2899
+ if (!module )
2900
+ module =GetModuleHandle (NULL );
2901
+
2883
2902
if (GetWinVersion ()>=WIN_VER_WIN10)
2884
2903
{
2885
2904
HMODULE shlwapi=GetModuleHandle (L" shlwapi.dll" );
@@ -2888,12 +2907,14 @@ static void InitStartMenuDLL( void )
2888
2907
g_SHFillRectClr=(tSHFillRectClr)GetProcAddress (shlwapi,MAKEINTRESOURCEA (197 ));
2889
2908
if (g_SHFillRectClr)
2890
2909
{
2891
- g_SHFillRectClrHook=SetIatHook (GetModuleHandle ( NULL ) ," shlwapi.dll" ,MAKEINTRESOURCEA (197 ),SHFillRectClr2);
2910
+ g_SHFillRectClrHook=SetIatHook (module ," shlwapi.dll" ,MAKEINTRESOURCEA (197 ),SHFillRectClr2);
2892
2911
if (!g_SHFillRectClrHook)
2893
- g_SHFillRectClrHook=SetIatHook (GetModuleHandle ( NULL ) ," api-ms-win-shlwapi-winrt-storage-l1-1-1.dll" ,MAKEINTRESOURCEA (197 ),SHFillRectClr2);
2912
+ g_SHFillRectClrHook=SetIatHook (module ," api-ms-win-shlwapi-winrt-storage-l1-1-1.dll" ,MAKEINTRESOURCEA (197 ),SHFillRectClr2);
2894
2913
}
2895
2914
}
2896
- g_StretchDIBitsHook=SetIatHook (GetModuleHandle (NULL )," gdi32.dll" ," StretchDIBits" ,StretchDIBits2);
2915
+ g_StretchDIBitsHook=SetIatHook (module ," gdi32.dll" ," StretchDIBits" ,StretchDIBits2);
2916
+ if (!g_StretchDIBitsHook)
2917
+ g_StretchDIBitsHook=SetIatHook (module ," ext-ms-win-gdi-draw-l1-1-0.dll" ," StretchDIBits" ,StretchDIBits2);
2897
2918
}
2898
2919
2899
2920
{
@@ -2903,12 +2924,12 @@ static void InitStartMenuDLL( void )
2903
2924
}
2904
2925
2905
2926
if (GetWinVersion ()<=WIN_VER_WIN81)
2906
- g_DrawThemeBackgroundHook=SetIatHook (GetModuleHandle ( NULL ) ," uxtheme.dll" ," DrawThemeBackground" ,DrawThemeBackground2);
2907
- g_DrawThemeTextHook=SetIatHook (GetModuleHandle ( NULL ) ," uxtheme.dll" ," DrawThemeText" ,DrawThemeText2);
2908
- g_DrawThemeTextExHook=SetIatHook (GetModuleHandle ( NULL ) ," uxtheme.dll" ," DrawThemeTextEx" ,DrawThemeTextEx2);
2927
+ g_DrawThemeBackgroundHook=SetIatHook (module ," uxtheme.dll" ," DrawThemeBackground" ,DrawThemeBackground2);
2928
+ g_DrawThemeTextHook=SetIatHook (module ," uxtheme.dll" ," DrawThemeText" ,DrawThemeText2);
2929
+ g_DrawThemeTextExHook=SetIatHook (module ," uxtheme.dll" ," DrawThemeTextEx" ,DrawThemeTextEx2);
2909
2930
g_DrawThemeTextCtlHook=SetIatHook (GetModuleHandle (L" comctl32.dll" )," uxtheme.dll" ," DrawThemeText" ,DrawThemeText2);
2910
2931
if (GetWinVersion ()>=WIN_VER_WIN10)
2911
- g_SetWindowCompositionAttributeHook=SetIatHook (GetModuleHandle ( NULL ) ," user32.dll" ," SetWindowCompositionAttribute" ,SetWindowCompositionAttribute2);
2932
+ g_SetWindowCompositionAttributeHook=SetIatHook (module ," user32.dll" ," SetWindowCompositionAttribute" ,SetWindowCompositionAttribute2);
2912
2933
}
2913
2934
2914
2935
g_TaskbarThreadId=GetCurrentThreadId ();
@@ -2947,9 +2968,18 @@ static void InitStartMenuDLL( void )
2947
2968
if (taskBar.rebar )
2948
2969
{
2949
2970
SetWindowSubclass (taskBar.rebar ,SubclassRebarProc,' CLSH' ,taskbarId);
2971
+ // TaskBand window
2950
2972
HWND hwnd=FindWindowEx (taskBar.rebar ,NULL ,L" MSTaskSwWClass" ,NULL );
2951
2973
if (hwnd)
2952
- taskBar.taskList =FindWindowEx (hwnd,NULL ,L" MSTaskListWClass" ,NULL );
2974
+ {
2975
+ taskBar.taskList =hwnd;
2976
+ // TaskList window
2977
+ // it has to be visible, otherwise it won't receive WM_PAINT that we need to intercept
2978
+ // in such case we will intercept parent instead
2979
+ hwnd=FindWindowEx (hwnd,NULL ,L" MSTaskListWClass" ,NULL );
2980
+ if (hwnd&&IsWindowVisible (hwnd))
2981
+ taskBar.taskList =hwnd;
2982
+ }
2953
2983
if (taskBar.taskList )
2954
2984
SetWindowSubclass (taskBar.taskList ,SubclassTaskListProc,' CLSH' ,taskbarId);
2955
2985
}
0 commit comments