1
0
mirror of https://github.com/narzoul/DDrawCompat synced 2024-12-30 08:55:36 +01:00

Replace AW_BLEND with AW_SLIDE in AnimateWindow

Workaround for broken tooltip fade effect, e.g. in toolbar of file dialog.
This commit is contained in:
narzoul 2023-10-15 23:19:00 +02:00
parent 97805b17b6
commit d9273c654d

View File

@ -82,6 +82,17 @@ namespace
LONG WINAPI setWindowLongA(HWND hWnd, int nIndex, LONG dwNewLong);
void setWindowProc(HWND hwnd, WNDPROC wndProcA, WNDPROC wndProcW);
BOOL WINAPI animateWindow(HWND hWnd, DWORD dwTime, DWORD dwFlags)
{
LOG_FUNC("AnimateWindow", hWnd, dwTime, Compat::hex(dwFlags));
if (dwFlags & AW_BLEND)
{
dwFlags &= ~AW_BLEND;
dwFlags |= AW_SLIDE | AW_HOR_POSITIVE;
}
return LOG_RESULT(CALL_ORIG_FUNC(AnimateWindow)(hWnd, dwTime, dwFlags));
}
template <auto func, typename Result, typename... Params>
Result WINAPI createDialog(Params... params)
{
@ -840,6 +851,7 @@ namespace Gdi
void installHooks()
{
HOOK_FUNCTION(user32, AnimateWindow, animateWindow);
HOOK_FUNCTION(user32, CreateDialogIndirectParamA, createDialog<CreateDialogIndirectParamA>);
HOOK_FUNCTION(user32, CreateDialogIndirectParamW, createDialog<CreateDialogIndirectParamW>);
HOOK_FUNCTION(user32, CreateDialogParamA, createDialog<CreateDialogParamA>);