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

do not return WM_NULL for now (needs more testing)

This commit is contained in:
FunkyFr3sh 2024-09-09 15:31:18 +02:00
parent c1a5a3895b
commit a42bdae84d

View File

@ -614,7 +614,7 @@ HHOOK WINAPI fake_SetWindowsHookExA(int idHook, HOOKPROC lpfn, HINSTANCE hmod, D
void HandleMessage(LPMSG lpMsg, HWND hWnd) void HandleMessage(LPMSG lpMsg, HWND hWnd)
{ {
if (lpMsg && g_ddraw.ref && g_ddraw.hwnd && g_ddraw.width && !g_config.fixmousehook) if (lpMsg && g_ddraw.ref && g_ddraw.hwnd && g_ddraw.width)
{ {
if (!g_config.windowed || real_ScreenToClient(g_ddraw.hwnd, &lpMsg->pt)) if (!g_config.windowed || real_ScreenToClient(g_ddraw.hwnd, &lpMsg->pt))
{ {
@ -652,7 +652,8 @@ void HandleMessage(LPMSG lpMsg, HWND hWnd)
mouse_lock(); mouse_lock();
lpMsg->message = (UINT)MAKELONG(WM_NULL, HIWORD(lpMsg->message)); //lpMsg->message = (UINT)MAKELONG(WM_NULL, HIWORD(lpMsg->message));
break;
} }
break; break;
@ -674,13 +675,12 @@ void HandleMessage(LPMSG lpMsg, HWND hWnd)
if (!g_config.devmode && !g_mouse_locked) if (!g_config.devmode && !g_mouse_locked)
{ {
// Does not work with 'New Robinson' // Does not work with 'New Robinson'
lpMsg->message = (UINT)MAKELONG(WM_NULL, HIWORD(lpMsg->message)); //lpMsg->message = (UINT)MAKELONG(WM_NULL, HIWORD(lpMsg->message));
break; break;
} }
InterlockedExchange((LONG*)&g_ddraw.cursor.x, GET_X_LPARAM(lpMsg->lParam)); InterlockedExchange((LONG*)&g_ddraw.cursor.x, GET_X_LPARAM(lpMsg->lParam));
InterlockedExchange((LONG*)&g_ddraw.cursor.y, GET_Y_LPARAM(lpMsg->lParam)); InterlockedExchange((LONG*)&g_ddraw.cursor.y, GET_Y_LPARAM(lpMsg->lParam));
break; break;
} }
} }