AdjustWindowRectEx function user32

Win32Result<bool> AdjustWindowRectEx(
  1. Pointer<RECT> lpRect,
  2. WINDOW_STYLE dwStyle,
  3. bool bMenu,
  4. WINDOW_EX_STYLE dwExStyle,
)

Calculates the required size of the window rectangle, based on the desired size of the client rectangle.

The window rectangle can then be passed to the CreateWindowEx function to create a window whose client area is the desired size.

To learn more, see learn.microsoft.com/windows/win32/api/winuser/nf-winuser-adjustwindowrectex.

Implementation

Win32Result<bool> AdjustWindowRectEx(
  Pointer<RECT> lpRect,
  WINDOW_STYLE dwStyle,
  bool bMenu,
  WINDOW_EX_STYLE dwExStyle,
) {
  resolveGetLastError();
  final result_ = _AdjustWindowRectEx(
    lpRect,
    dwStyle,
    bMenu ? TRUE : FALSE,
    dwExStyle,
  );
  return .new(value: result_ != FALSE, error: GetLastError());
}