SetWindowPos function user32
Changes the size, position, and Z order of a child, pop-up, or top-level window.
These windows are ordered according to their appearance on the screen. The topmost window receives the highest rank and is the first window in the Z order.
To learn more, see learn.microsoft.com/windows/win32/api/winuser/nf-winuser-setwindowpos.
Implementation
Win32Result<bool> SetWindowPos(
HWND hWnd,
HWND? hWndInsertAfter,
int x,
int y,
int cx,
int cy,
SET_WINDOW_POS_FLAGS uFlags,
) {
resolveGetLastError();
final result_ = _SetWindowPos(
hWnd,
hWndInsertAfter ?? nullptr,
x,
y,
cx,
cy,
uFlags,
);
return .new(value: result_ != FALSE, error: GetLastError());
}