1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-24 17:49:52 +01:00

make sure we don'T double hook

This commit is contained in:
FunkyFr3sh 2024-05-31 02:23:30 +02:00
parent 0e9e3f9d7a
commit 0be22be87b

View File

@ -674,7 +674,7 @@ BOOL WINAPI fake_GetMessageA(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wM
{ {
BOOL result = real_GetMessageA(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax); BOOL result = real_GetMessageA(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax);
if (result && lpMsg && g_ddraw.ref && g_ddraw.hwnd && g_ddraw.width) if (result && lpMsg && g_ddraw.ref && g_ddraw.hwnd && g_ddraw.width && !g_config.fixmousehook)
{ {
if (!g_config.windowed || real_ScreenToClient(g_ddraw.hwnd, &lpMsg->pt)) if (!g_config.windowed || real_ScreenToClient(g_ddraw.hwnd, &lpMsg->pt))
{ {
@ -712,7 +712,7 @@ BOOL WINAPI fake_PeekMessageA(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT w
{ {
BOOL result = real_PeekMessageA(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg); BOOL result = real_PeekMessageA(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg);
if (result && lpMsg && g_ddraw.ref && g_ddraw.hwnd && g_ddraw.width) if (result && lpMsg && g_ddraw.ref && g_ddraw.hwnd && g_ddraw.width && !g_config.fixmousehook)
{ {
if (!g_config.windowed || real_ScreenToClient(g_ddraw.hwnd, &lpMsg->pt)) if (!g_config.windowed || real_ScreenToClient(g_ddraw.hwnd, &lpMsg->pt))
{ {