SendMessageTimeout function user32

Win32Result<LRESULT> SendMessageTimeout(
  1. HWND hWnd,
  2. int msg,
  3. WPARAM wParam,
  4. LPARAM lParam,
  5. SEND_MESSAGE_TIMEOUT_FLAGS fuFlags,
  6. int uTimeout,
  7. Pointer<IntPtr>? lpdwResult,
)

Sends the specified message to one or more windows.

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

Implementation

Win32Result<LRESULT> SendMessageTimeout(
  HWND hWnd,
  int msg,
  WPARAM wParam,
  LPARAM lParam,
  SEND_MESSAGE_TIMEOUT_FLAGS fuFlags,
  int uTimeout,
  Pointer<IntPtr>? lpdwResult,
) {
  resolveGetLastError();
  final result_ = _SendMessageTimeout(
    hWnd,
    msg,
    wParam,
    lParam,
    fuFlags,
    uTimeout,
    lpdwResult ?? nullptr,
  );
  return .new(value: .new(result_), error: GetLastError());
}