Use SDL for Win32API.SetWindowText

This commit is contained in:
Inori 2019-08-09 08:14:02 -04:00
parent 00614270aa
commit 3b36b56c4b
3 changed files with 11 additions and 0 deletions

View file

@ -48,6 +48,7 @@ MiniFFI_GetFunctionHandle(void *lib, const char *func)
CAPTURE(GetCursorPos);
CAPTURE(ScreenToClient);
CAPTURE(SetWindowPos);
CAPTURE(SetWindowTextA);
CAPTURE(GetWindowRect);
CAPTURE(RegisterHotKey);
#endif

View file

@ -115,6 +115,13 @@ MKXP_SetWindowPos(HWND hWnd,
return true;
}
BOOL __stdcall
MKXP_SetWindowTextA(HWND hWnd, LPCSTR lpString)
{
SDL_SetWindowTitle(shState->sdlWindow(), (const char*)lpString);
return true;
}
// Games that use this to resize the window won't center
// themselves, but it's better than having the window sent

View file

@ -63,6 +63,9 @@ MKXP_SetWindowPos(HWND hWnd,
int cy,
UINT uFlags);
BOOL __stdcall
MKXP_SetWindowTextA(HWND hWnd, LPCSTR lpString);
BOOL __stdcall
MKXP_GetWindowRect(HWND hWnd, LPRECT lpRect);