Resurrect mouse detection

This commit is contained in:
Inori 2019-08-06 22:43:19 -04:00 committed by Inori
parent 56c6d4b441
commit ad0cf67cb9
3 changed files with 15 additions and 1 deletions

View file

@ -44,6 +44,7 @@ MiniFFI_GetFunctionHandle(void *lib, const char *func)
CAPTURE(GetWindowThreadProcessId);
CAPTURE(FindWindowEx);
CAPTURE(GetForegroundWindow);
CAPTURE(GetClientRect);
CAPTURE(GetCursorPos);
CAPTURE(ScreenToClient);
CAPTURE(SetWindowPos);

View file

@ -6,6 +6,7 @@
#include "sharedstate.h"
#include "fake-api.h"
#include "debugwriter.h"
// Essentials, without edits, needs Win32API. Two problems with that:
@ -65,6 +66,16 @@ MKXP_GetForegroundWindow(void)
return 0;
}
BOOL __stdcall
MKXP_GetClientRect(HWND hWnd, LPRECT lpRect)
{
SDL_GetWindowSize(shState->sdlWindow(),
(int*)&lpRect->right,
(int*)&lpRect->bottom);
return true;
}
// FIXME: Mouse stuff doesn't work right now,
// but at least it's not causing any Ruby exceptions
@ -82,7 +93,6 @@ MKXP_ScreenToClient(HWND hWnd, LPPOINT lpPoint)
return true;
}
BOOL __stdcall
MKXP_SetWindowPos(HWND hWnd,
HWND hWndInsertAfter,

View file

@ -45,6 +45,9 @@ MKXP_FindWindowEx(HWND hWnd,
DWORD __stdcall
MKXP_GetForegroundWindow(void);
BOOL __stdcall
MKXP_GetClientRect(HWND hWnd, LPRECT lpRect);
BOOL __stdcall
MKXP_GetCursorPos(LPPOINT lpPoint);