Queue objects are used for addressing and processing of messages.
Queues are used for effective dispatching of messages. One can add several handlers and define, which messages each handler will handle. This allows to make an application code more structured and avoid huge message processing functions, so common in early days of Windows programming.
When the message is received by the queue, it searches for the proper handler in the list of handlers. If the handler is not found, OnUnhandledMessage event is fired.