unsigned get_queue_status(unsigned flags)
This function may be used to determine the type of messages that currently reside in the message queue.
A set of flags indicating the type of messages for which a check is made. This parameter may be a combination of flags from the enumeration queue_status.
The high-order part of the return value contains the types of messages currently residing in the queue. The low-order part indicates the types of messages that have been added to (and remain in) the queue since the last call to one of the functions get_queue_status, get_message or peek_message.
The presence of a queue status flag within the value returned does not guarantee that a subsequent call to one of the functions get_message or peek_message will return a message of that type. This is because these functions perform filtering - which may cause the message to be processed internally. For this reason, the value returned by this function should be considered only a hint as to whether the function get_message or peek_message be called.
The flags queue_status::allPost and queue_status::Post differ in when they are cleared. The flag queue_status::Post is cleared when a call is made to either of the functions get_message or peek_message - whether or not messages filtering is in effect. The flag queue_status::allPost is cleared upon making a call to the function get_message or peek_message without filtering. These facts may be useful when making multiple calls to peek_message to obtain messages in different ranges.