mirror of
https://github.com/Open-Shell/Open-Shell-Menu.git
synced 2026-06-14 03:16:38 +10:00
@@ -67,6 +67,8 @@ static SIZE g_TaskbarTextureSize;
|
|||||||
static TTaskbarTile g_TaskbarTileH, g_TaskbarTileV;
|
static TTaskbarTile g_TaskbarTileH, g_TaskbarTileV;
|
||||||
static RECT g_TaskbarMargins;
|
static RECT g_TaskbarMargins;
|
||||||
int g_CurrentCSMTaskbar=-1, g_CurrentWSMTaskbar=-1;
|
int g_CurrentCSMTaskbar=-1, g_CurrentWSMTaskbar=-1;
|
||||||
|
// ExplorerPatcher taskbar
|
||||||
|
static bool g_epTaskbar = false;
|
||||||
|
|
||||||
static void FindWindowsMenu( void );
|
static void FindWindowsMenu( void );
|
||||||
static void RecreateStartButton( size_t taskbarId );
|
static void RecreateStartButton( size_t taskbarId );
|
||||||
@@ -2772,6 +2774,17 @@ static void WINAPI SHFillRectClr2( HDC hdc, const RECT *pRect, COLORREF color )
|
|||||||
g_SHFillRectClr(hdc,pRect,color);
|
g_SHFillRectClr(hdc,pRect,color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static IatHookData* g_ExtTextOutWHook = nullptr;
|
||||||
|
|
||||||
|
// used by ExplorerPatcher's custom implementation of `SHFillRectClr`
|
||||||
|
static BOOL WINAPI ExtTextOutW2(HDC hdc, int X, int Y, UINT fuOptions, const RECT* lprc, LPCWSTR lpString, UINT cbCount, const INT* lpDx)
|
||||||
|
{
|
||||||
|
if (fuOptions != ETO_OPAQUE || lpString || cbCount || lpDx || !g_CurrentTaskList || !g_TaskbarTexture || GetCurrentThreadId() != g_TaskbarThreadId)
|
||||||
|
return ExtTextOutW(hdc, X, Y, fuOptions, lprc, lpString, cbCount, lpDx);
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
static HRESULT STDAPICALLTYPE DrawThemeBackground2( HTHEME hTheme, HDC hdc, int iPartId, int iStateId, LPCRECT pRect, LPCRECT pClipRect )
|
static HRESULT STDAPICALLTYPE DrawThemeBackground2( HTHEME hTheme, HDC hdc, int iPartId, int iStateId, LPCRECT pRect, LPCRECT pClipRect )
|
||||||
{
|
{
|
||||||
if (g_CurrentTaskList && g_TaskbarTexture && iPartId==1 && iStateId==0 && GetCurrentThreadId()==g_TaskbarThreadId)
|
if (g_CurrentTaskList && g_TaskbarTexture && iPartId==1 && iStateId==0 && GetCurrentThreadId()==g_TaskbarThreadId)
|
||||||
@@ -2956,6 +2969,15 @@ static void InitStartMenuDLL( void )
|
|||||||
if (GetSettingBool(L"CustomTaskbar"))
|
if (GetSettingBool(L"CustomTaskbar"))
|
||||||
{
|
{
|
||||||
auto module=GetModuleHandle(L"taskbar.dll");
|
auto module=GetModuleHandle(L"taskbar.dll");
|
||||||
|
if (!module)
|
||||||
|
{
|
||||||
|
module = GetModuleHandle(L"ep_taskbar.5.dll");
|
||||||
|
if (!module)
|
||||||
|
module = GetModuleHandle(L"ep_taskbar.2.dll");
|
||||||
|
|
||||||
|
if (module)
|
||||||
|
g_epTaskbar = true;
|
||||||
|
}
|
||||||
if (!module)
|
if (!module)
|
||||||
module=GetModuleHandle(NULL);
|
module=GetModuleHandle(NULL);
|
||||||
|
|
||||||
@@ -2975,6 +2997,10 @@ static void InitStartMenuDLL( void )
|
|||||||
g_StretchDIBitsHook=SetIatHook(module,"gdi32.dll","StretchDIBits",StretchDIBits2);
|
g_StretchDIBitsHook=SetIatHook(module,"gdi32.dll","StretchDIBits",StretchDIBits2);
|
||||||
if (!g_StretchDIBitsHook)
|
if (!g_StretchDIBitsHook)
|
||||||
g_StretchDIBitsHook=SetIatHook(module,"ext-ms-win-gdi-draw-l1-1-0.dll","StretchDIBits",StretchDIBits2);
|
g_StretchDIBitsHook=SetIatHook(module,"ext-ms-win-gdi-draw-l1-1-0.dll","StretchDIBits",StretchDIBits2);
|
||||||
|
|
||||||
|
// ExplorerPatcher compatibility
|
||||||
|
if (g_epTaskbar)
|
||||||
|
g_ExtTextOutWHook = SetIatHook(module, "gdi32.dll", "ExtTextOutW", ExtTextOutW2);
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -3230,6 +3256,8 @@ static void CleanStartMenuDLL( void )
|
|||||||
g_SHFillRectClrHook=NULL;
|
g_SHFillRectClrHook=NULL;
|
||||||
ClearIatHook(g_StretchDIBitsHook);
|
ClearIatHook(g_StretchDIBitsHook);
|
||||||
g_StretchDIBitsHook=NULL;
|
g_StretchDIBitsHook=NULL;
|
||||||
|
ClearIatHook(g_ExtTextOutWHook);
|
||||||
|
g_ExtTextOutWHook = NULL;
|
||||||
|
|
||||||
ClearIatHook(g_DrawThemeBackgroundHook);
|
ClearIatHook(g_DrawThemeBackgroundHook);
|
||||||
g_DrawThemeBackgroundHook=NULL;
|
g_DrawThemeBackgroundHook=NULL;
|
||||||
|
|||||||
Reference in New Issue
Block a user