ScrollWindow function user32

Win32Result<bool> ScrollWindow(
  1. HWND hWnd,
  2. int xAmount,
  3. int yAmount,
  4. Pointer<RECT>? lpRect,
  5. Pointer<RECT>? lpClipRect,
)

Scrolls the contents of the specified window's client area.

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

Implementation

Win32Result<bool> ScrollWindow(
  HWND hWnd,
  int xAmount,
  int yAmount,
  Pointer<RECT>? lpRect,
  Pointer<RECT>? lpClipRect,
) {
  resolveGetLastError();
  final result_ = _ScrollWindow(
    hWnd,
    xAmount,
    yAmount,
    lpRect ?? nullptr,
    lpClipRect ?? nullptr,
  );
  return .new(value: result_ != FALSE, error: GetLastError());
}