@@ -67,6 +67,8 @@ static SIZE g_TaskbarTextureSize;
67
67
static TTaskbarTile g_TaskbarTileH, g_TaskbarTileV;
68
68
static RECT g_TaskbarMargins;
69
69
int g_CurrentCSMTaskbar=-1 , g_CurrentWSMTaskbar=-1 ;
70
+ // ExplorerPatcher taskbar
71
+ static bool g_epTaskbar = false ;
70
72
71
73
static void FindWindowsMenu ( void );
72
74
static void RecreateStartButton ( size_t taskbarId );
@@ -2772,6 +2774,17 @@ static void WINAPI SHFillRectClr2( HDC hdc, const RECT *pRect, COLORREF color )
2772
2774
g_SHFillRectClr (hdc,pRect,color);
2773
2775
}
2774
2776
2777
+ static IatHookData* g_ExtTextOutWHook = nullptr ;
2778
+
2779
+ // used by ExplorerPatcher's custom implementation of `SHFillRectClr`
2780
+ static BOOL WINAPI ExtTextOutW2 (HDC hdc, int X, int Y, UINT fuOptions, const RECT* lprc, LPCWSTR lpString, UINT cbCount, const INT* lpDx)
2781
+ {
2782
+ if (fuOptions != ETO_OPAQUE || lpString || cbCount || lpDx || !g_CurrentTaskList || !g_TaskbarTexture || GetCurrentThreadId () != g_TaskbarThreadId)
2783
+ return ExtTextOutW (hdc, X, Y, fuOptions, lprc, lpString, cbCount, lpDx);
2784
+
2785
+ return FALSE ;
2786
+ }
2787
+
2775
2788
static HRESULT STDAPICALLTYPE DrawThemeBackground2 ( HTHEME hTheme, HDC hdc, int iPartId, int iStateId, LPCRECT pRect, LPCRECT pClipRect )
2776
2789
{
2777
2790
if (g_CurrentTaskList && g_TaskbarTexture && iPartId==1 && iStateId==0 && GetCurrentThreadId ()==g_TaskbarThreadId)
@@ -2956,6 +2969,15 @@ static void InitStartMenuDLL( void )
2956
2969
if (GetSettingBool (L" CustomTaskbar" ))
2957
2970
{
2958
2971
auto module=GetModuleHandle (L" taskbar.dll" );
2972
+ if (!module)
2973
+ {
2974
+ module = GetModuleHandle (L" ep_taskbar.5.dll" );
2975
+ if (!module)
2976
+ module = GetModuleHandle (L" ep_taskbar.2.dll" );
2977
+
2978
+ if (module)
2979
+ g_epTaskbar = true ;
2980
+ }
2959
2981
if (!module)
2960
2982
module=GetModuleHandle (NULL );
2961
2983
@@ -2975,6 +2997,10 @@ static void InitStartMenuDLL( void )
2975
2997
g_StretchDIBitsHook=SetIatHook (module," gdi32.dll" ," StretchDIBits" ,StretchDIBits2);
2976
2998
if (!g_StretchDIBitsHook)
2977
2999
g_StretchDIBitsHook=SetIatHook (module," ext-ms-win-gdi-draw-l1-1-0.dll" ," StretchDIBits" ,StretchDIBits2);
3000
+
3001
+ // ExplorerPatcher compatibility
3002
+ if (g_epTaskbar)
3003
+ g_ExtTextOutWHook = SetIatHook (module, " gdi32.dll" , " ExtTextOutW" , ExtTextOutW2);
2978
3004
}
2979
3005
2980
3006
{
@@ -3230,6 +3256,8 @@ static void CleanStartMenuDLL( void )
3230
3256
g_SHFillRectClrHook=NULL ;
3231
3257
ClearIatHook (g_StretchDIBitsHook);
3232
3258
g_StretchDIBitsHook=NULL ;
3259
+ ClearIatHook (g_ExtTextOutWHook);
3260
+ g_ExtTextOutWHook = NULL ;
3233
3261
3234
3262
ClearIatHook (g_DrawThemeBackgroundHook);
3235
3263
g_DrawThemeBackgroundHook=NULL ;
0 commit comments