During this call,the system delivers pending messages that were send to windows owned by
the calling thread using the SendMessage,SendMessageCallback,SendMessageTimeout or
SendNotifyMessage function. The system may also process internal events. Message are
processed in the folloing order:
Sent messages
Posted messages
Input(hardware) messages and system internal events
Sent messages(again)
WM_PAINT messags
WM_TIMER messags.