AdjustWindowRectExForDpi function user32

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

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

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

Implementation

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