PostThreadMessage function user32

Win32Result<bool> PostThreadMessage(
  1. int idThread,
  2. int msg,
  3. WPARAM wParam,
  4. LPARAM lParam,
)

Posts a message to the message queue of the specified thread.

It returns without waiting for the thread to process the message.

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

Implementation

Win32Result<bool> PostThreadMessage(
  int idThread,
  int msg,
  WPARAM wParam,
  LPARAM lParam,
) {
  resolveGetLastError();
  final result_ = _PostThreadMessage(idThread, msg, wParam, lParam);
  return .new(value: result_ != FALSE, error: GetLastError());
}