Today I would like to talk about window message queue. Many developers for Microsoft windows familiar with this subject. There are many books about this subject and honestly, I was under impression that each window has own message queue. I even asked many developers around me and most developers were telling the same story. Some believe that there is one message queue for process and some even believe that there is one queue for whole session.

Today I will try to get to bottom of this. If we read here https://docs.microsoft.com/en-us/windows/win32/winmsg/about-messages-and-message-queues you will see this: “The system maintains a single system message queue and one thread-specific message queue for each GUI thread”. Just to be clear GUI thread is