int get_message(queue* queue_message,
                handle window,
                unsigned filter_minimum=0,
                unsigned filter_maximum=0)

This function obtains a message from the queue.


queue* queue_message

A pointer to a buffer to hold the queue message to be retrieved.

handle window

The handle of the window for which a message is to be retrieved. Messages for child windows of the specified window are also retrieved. If null is specified, messages are retrieved for any window that belongs to the thread or any message posted directly to the queue.

unsigned filter_minimum

The lower bound (inclusive) for the identity of the message to be retrieved.

unsigned filter_maximum

The upper bound (inclusive) for the identity of the message to be retrieved.



true A message other than a quit message was retrieved.
false A quit message was retrieved.
-1 An error occurred.


Unlike peeking, this function blocks the calling thread until a message is received.

Only messages from the calling thread's queue are retrieved.

Because true is returned upon receipt of a quit message, the value returned by this function may be used to determine when to exit the message loop and terminate the application.