GetQueueStatus

3.1

  DWORD GetQueueStatus(fuFlags)    
  UINT fuFlags; /* queue-status flags, */  

The GetQueueStatus function returns a value that indicates the type of messages in the queue.

This function is very fast and is typically used inside speed-critical loops to determine whether the GetMessage or PeekMessage function should be called to process input.

GetQueueStatus returns two sets of information: whether any new messages have been added to the queue since GetQueueStatus, GetMessage, or PeekMessage was last called, and what kinds of events are currently in the queue.

Parameters

fuFlags

Specifies the queue-status flags to be retrieved. This parameter can be a combination of the following values:

Value Meaning

QS_KEY WM_CHAR message is in the queue.
QS_MOUSE WM_MOUSEMOVE or WM_*BUTTON* message is in the queue.
QS_MOUSEMOVE WM_MOUSEMOVE message is in the queue.
QS_MOUSEBUTTON WM_*BUTTON* message is in the queue.
QS_PAINT WM_PAINT message is in the queue.
QS_POSTMESSAGE Posted message other than those listed above is in the queue.
QS_SENDMESSAGE Message sent by another application is in the queue.
QS_TIMER WM_TIMER message is in the queue.

Return Value

The high-order word of the return value indicates the types of messages currently in the queue. The low-order word shows the types of messages added to the queue and are still in the queue since the last call to the GetQueueStatus, GetMessage, or PeekMessage function.

Comments

The existence of a QS_ flag in the return value does not guarantee that a subsequent call to the PeekMessage or GetMessage function will return a message. GetMessage and PeekMessage perform some internal filtering computation that may cause the message to be processed internally. For this reason, the return value from GetQueueStatus should be considered only a hint as to whether GetMessage or PeekMessage should be called.

See Also

GetInputState, GetMessage, PeekMessage