WaitMessage function user32

Win32Result<bool> WaitMessage()

Yields control to other threads when a thread has no other messages in its message queue.

The WaitMessage function suspends the thread and does not return until a new message is placed in the thread's message queue.

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

Implementation

Win32Result<bool> WaitMessage() {
  resolveGetLastError();
  final result_ = _WaitMessage();
  return .new(value: result_ != FALSE, error: GetLastError());
}