From 945b4c954ab0dcd8a44d630a1e159dac68aa9f8b Mon Sep 17 00:00:00 2001 From: FunkyFr3sh Date: Sun, 2 Dec 2018 06:18:28 +0100 Subject: [PATCH] don't allow window style changes --- src/mouse.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/mouse.c b/src/mouse.c index 154ca3f..93d75c2 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -446,6 +446,14 @@ LRESULT WINAPI fake_SendMessageA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lPar return result; } +LONG WINAPI fake_SetWindowLongA(HWND hWnd, int nIndex, LONG dwNewLong) +{ + if (ddraw && ddraw->hWnd == hWnd && nIndex == GWL_STYLE) + return 0; + + return SetWindowLongA(hWnd, nIndex, dwNewLong); +} + void mouse_init() { HookIAT(GetModuleHandle(NULL), "user32.dll", "GetCursorPos", (PROC)fake_GetCursorPos); @@ -464,5 +472,6 @@ void mouse_init() 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); + HookIAT(GetModuleHandle(NULL), "user32.dll", "SetWindowLongA", (PROC)fake_SetWindowLongA); mouse_active = TRUE; }