@@ -67,6 +67,8 @@ static SIZE g_TaskbarTextureSize;
6767static TTaskbarTile g_TaskbarTileH, g_TaskbarTileV;
6868static RECT g_TaskbarMargins;
6969int g_CurrentCSMTaskbar=-1 , g_CurrentWSMTaskbar=-1 ;
70+ // ExplorerPatcher taskbar
71+ static bool g_epTaskbar = false ;
7072
7173static void FindWindowsMenu ( void );
7274static void RecreateStartButton ( size_t taskbarId );
@@ -1342,7 +1344,7 @@ static void UpdateStartButtonPosition(const TaskbarInfo* taskBar, const WINDOWPO
13421344
13431345 // Start button on Win11 is a bit shifted to the right
13441346 // We will shift our Aero button to cover original button
1345- if (IsWin11 () && (x == info.rcMonitor .left ) && (GetStartButtonType () == START_BUTTON_AERO))
1347+ if (IsWin11 () && (x == info.rcMonitor .left ) && (GetStartButtonType () == START_BUTTON_AERO) && !g_epTaskbar )
13461348 x += ScaleForDpi (taskBar->taskBar , 6 );
13471349 }
13481350
@@ -2772,6 +2774,17 @@ static void WINAPI SHFillRectClr2( HDC hdc, const RECT *pRect, COLORREF color )
27722774 g_SHFillRectClr (hdc,pRect,color);
27732775}
27742776
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+
27752788static HRESULT STDAPICALLTYPE DrawThemeBackground2 ( HTHEME hTheme, HDC hdc, int iPartId, int iStateId, LPCRECT pRect, LPCRECT pClipRect )
27762789{
27772790 if (g_CurrentTaskList && g_TaskbarTexture && iPartId==1 && iStateId==0 && GetCurrentThreadId ()==g_TaskbarThreadId)
@@ -2956,6 +2969,15 @@ static void InitStartMenuDLL( void )
29562969 if (GetSettingBool (L" CustomTaskbar" ))
29572970 {
29582971 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+ }
29592981 if (!module )
29602982 module =GetModuleHandle (NULL );
29612983
@@ -2975,6 +2997,10 @@ static void InitStartMenuDLL( void )
29752997 g_StretchDIBitsHook=SetIatHook (module ," gdi32.dll" ," StretchDIBits" ,StretchDIBits2);
29762998 if (!g_StretchDIBitsHook)
29772999 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);
29783004 }
29793005
29803006 {
@@ -3204,6 +3230,7 @@ static void RecreateStartButton( size_t taskbarId )
32043230 {
32053231 RECT rc;
32063232 GetWindowRect (btn,&rc);
3233+ MapWindowPoints (NULL ,taskBar.taskBar ,(POINT*)&rc,2 ); // convert to taskbar coordinates
32073234 SetWindowPos (btn,HWND_TOP,rc.left ,rc.top ,0 ,0 ,SWP_NOSIZE|SWP_NOACTIVATE|SWP_NOZORDER);
32083235 }
32093236 }
@@ -3230,6 +3257,8 @@ static void CleanStartMenuDLL( void )
32303257 g_SHFillRectClrHook=NULL ;
32313258 ClearIatHook (g_StretchDIBitsHook);
32323259 g_StretchDIBitsHook=NULL ;
3260+ ClearIatHook (g_ExtTextOutWHook);
3261+ g_ExtTextOutWHook = NULL ;
32333262
32343263 ClearIatHook (g_DrawThemeBackgroundHook);
32353264 g_DrawThemeBackgroundHook=NULL ;
0 commit comments