At the beginning I would like to clarify on details of Windows message queue. Many people believe that InvalidateRect function (or any other action that makes your window have update region) will actually post WM_PAINT message into message queue. Similarly, they believe that any mouse movement will leads to insert of WM_MOUSEMOVE (and corresponding messages like WM_HCHITTEST). But in reality, it is quite different (unless there is call to PeekMessage with PM_NOREMOVE). It is not important from processing these messages but very important to understand these details to troubleshoot any problems.

When part of window is invalidated Windows will simply set flag that indicates that window needs painting and that’s it. There is nothing inserted at message queue at all.