MESSAGE LOOP
The message loop is the code in the Win 32 based application. It retrieves messages from the application's message queue and passes these to the related window procedure. The messages are retrieved in First - In, First Out order (FIFO). The code snippet above describes the message loop. The message received for the window represented by the hWnd is read and stored in the structure msg. The functions TranslateMessage and DispatchMessage are dependable for moving the window by clicking on the title.