Improve compatibility with WindowBlinds

`Open-Shell` hooks `SHFillRectClr` (ordinal 197) API from `shlwapi.dll`
in order to be able to customize taskbar.

The API is hooked even if taskbar customization is disabled in `Open-Shell` (default).

`WindowBlinds` hooks the same API so this is causing clashes between
both programs.
In fact `Open-Shell` hooks later which makes `WindowBlinds` hook to be
completely ignored.

The solution would be to hook only if taskbar customization is enabled.

This way `Open-Shell` should be more compatible with other customization
tools in default state.

Fixes #433.
This commit is contained in:
ge0rdi
2020-10-18 09:10:54 +02:00
parent f197c9f43d
commit a5f35b133f
+6 -2
View File
@@ -2790,6 +2790,9 @@ static void OpenCortana( void )
static void InitStartMenuDLL( void )
{
LogToFile(STARTUP_LOG, L"StartMenu DLL: InitStartMenuDLL");
WaitDllInitThread();
InitializeIatHooks();
if (IsWin81Update1())
{
@@ -2817,6 +2820,8 @@ static void InitStartMenuDLL( void )
}
}
if (GetSettingBool(L"CustomTaskbar"))
{
if (GetWinVersion()>=WIN_VER_WIN10)
{
HMODULE shlwapi=GetModuleHandle(L"shlwapi.dll");
@@ -2846,10 +2851,9 @@ static void InitStartMenuDLL( void )
g_DrawThemeTextCtlHook=SetIatHook(GetModuleHandle(L"comctl32.dll"),"uxtheme.dll","DrawThemeText",DrawThemeText2);
if (GetWinVersion()>=WIN_VER_WIN10)
g_SetWindowCompositionAttributeHook=SetIatHook(GetModuleHandle(NULL),"user32.dll","SetWindowCompositionAttribute",SetWindowCompositionAttribute2);
}
g_TaskbarThreadId=GetCurrentThreadId();
LogToFile(STARTUP_LOG,L"StartMenu DLL: InitStartMenuDLL");
WaitDllInitThread();
g_bTrimHooks=GetWinVersion()==WIN_VER_WIN7 && (GetSettingInt(L"CompatibilityFixes")&COMPATIBILITY_TRIM_HOOKS);
InitManagers(false);
int level=GetSettingInt(L"CrashDump");