mirror of
https://github.com/FunkyFr3sh/cnc-ddraw.git
synced 2025-03-24 17:49:52 +01:00
fix misaligned comboboxes in TS and YR
This commit is contained in:
parent
e4a5c35f65
commit
f009a4d181
15
src/mouse.c
15
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);
|
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()
|
void mouse_init()
|
||||||
{
|
{
|
||||||
HookIAT(GetModuleHandle(NULL), "user32.dll", "GetCursorPos", (PROC)fake_GetCursorPos);
|
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", "GetSystemMetrics", (PROC)fake_GetSystemMetrics);
|
||||||
HookIAT(GetModuleHandle(NULL), "user32.dll", "SetWindowPos", (PROC)fake_SetWindowPos);
|
HookIAT(GetModuleHandle(NULL), "user32.dll", "SetWindowPos", (PROC)fake_SetWindowPos);
|
||||||
HookIAT(GetModuleHandle(NULL), "user32.dll", "MoveWindow", (PROC)fake_MoveWindow);
|
HookIAT(GetModuleHandle(NULL), "user32.dll", "MoveWindow", (PROC)fake_MoveWindow);
|
||||||
|
HookIAT(GetModuleHandle(NULL), "user32.dll", "SendMessageA", (PROC)fake_SendMessageA);
|
||||||
mouse_active = TRUE;
|
mouse_active = TRUE;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user