Traditionally in Windows there is standard message loop that consist of GetMessage, TranslateMessage and DispatchMessage. There are variations but most cases it is like this. One popular case is to use PeekMessage instead of GetMessage. Usually this message loop is in center of your application and in many modern frameworks it is not even visible. It is mostly hidden from developer.

But in some cases, it is required to create your own message loop. There are many cases when it is beneficial to do. As result there is main message loop that processing messages and in a reaction on some message, second message loop is started. Then in reaction on