diff --git a/binding/miniffi-binding.cpp b/binding/miniffi-binding.cpp index c543318f..084b9d96 100644 --- a/binding/miniffi-binding.cpp +++ b/binding/miniffi-binding.cpp @@ -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); diff --git a/src/fake-api.cpp b/src/fake-api.cpp index 86e9b426..8976cf4e 100644 --- a/src/fake-api.cpp +++ b/src/fake-api.cpp @@ -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, diff --git a/src/fake-api.h b/src/fake-api.h index de334f6f..92d155d2 100644 --- a/src/fake-api.h +++ b/src/fake-api.h @@ -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);