Implement SetWindowPos

This commit is contained in:
Anders Jenbo 2025-05-16 20:53:52 +02:00
parent 115fa35d5a
commit 4c6549725c
2 changed files with 23 additions and 5 deletions

View File

@ -16,7 +16,7 @@
#define CALLBACK
#define FAR
#define WINAPI
#define HWND_NOTOPMOST (HWND) - 2
#define HWND_NOTOPMOST -2
#define RGB(r, g, b) ((r) | ((g) << 8) | ((b) << 16))
#define S_OK ((HRESULT) 0)
#define E_NOINTERFACE (0x80004002)
@ -147,10 +147,7 @@ struct IUnknown {
int m_refCount;
};
inline BOOL SetWindowPos(HWND hWnd, HWND hWndInsertAfter, int X, int Y, int cx, int cy, UINT uFlags)
{
return TRUE;
}
BOOL SetWindowPos(HWND hWnd, int hWndInsertAfter, int X, int Y, int cx, int cy, UINT uFlags);
inline HDC WINAPI GetDC(HWND hWnd)
{

View File

@ -25,6 +25,27 @@ HRESULT IUnknown::QueryInterface(const GUID& riid, void** ppvObject)
return E_NOINTERFACE;
}
BOOL SetWindowPos(HWND hWnd, int hWndInsertAfter, int X, int Y, int cx, int cy, UINT uFlags)
{
if (!hWnd) {
return FALSE;
}
if (!(uFlags & SWP_NOACTIVATE)) {
SDL_RaiseWindow(hWnd);
}
if (!(uFlags & SWP_NOSIZE)) {
SDL_SetWindowSize(hWnd, cx, cy);
}
if (!(uFlags & SWP_NOMOVE)) {
SDL_SetWindowPosition(hWnd, X, Y);
}
return TRUE;
}
VOID WINAPI Sleep(DWORD dwMilliseconds)
{
SDL_Delay(dwMilliseconds);