From f009a4d181bc01e113ca8a06c4dd77d8e9863020 Mon Sep 17 00:00:00 2001 From: FunkyFr3sh Date: Fri, 16 Nov 2018 00:37:09 +0100 Subject: [PATCH] fix misaligned comboboxes in TS and YR --- src/mouse.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/mouse.c b/src/mouse.c index 2f7a7cc..6d56804 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -421,6 +421,20 @@ BOOL WINAPI fake_MoveWindow(HWND hWnd, int X, int Y, int nWidth, int nHeight, BO return MoveWindow(hWnd, X, Y, nWidth, nHeight, bRepaint); } +LRESULT WINAPI fake_SendMessageA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) +{ + LRESULT result = SendMessageA(hWnd, Msg, wParam, lParam); + + if (result && ddraw && Msg == CB_GETDROPPEDCONTROLRECT) + { + RECT *rc = (RECT *)lParam; + if (rc) + MapWindowPoints(HWND_DESKTOP, ddraw->hWnd, (LPPOINT)rc, 2); + } + + return result; +} + void mouse_init() { HookIAT(GetModuleHandle(NULL), "user32.dll", "GetCursorPos", (PROC)fake_GetCursorPos); @@ -438,5 +452,6 @@ void mouse_init() HookIAT(GetModuleHandle(NULL), "user32.dll", "GetSystemMetrics", (PROC)fake_GetSystemMetrics); HookIAT(GetModuleHandle(NULL), "user32.dll", "SetWindowPos", (PROC)fake_SetWindowPos); HookIAT(GetModuleHandle(NULL), "user32.dll", "MoveWindow", (PROC)fake_MoveWindow); + HookIAT(GetModuleHandle(NULL), "user32.dll", "SendMessageA", (PROC)fake_SendMessageA); mouse_active = TRUE; }