Ge van Geldorp wrote:
From: Thomas Weidenmueller
I get the messages in the following order:
received WM_NCPAINT Before GetUpdateRect After GetUpdateRect
That's during the initial paint, the WM_NCPAINT is sent during window creation then so there's no need for GetUpdateRect to send it again. Try clicking in the window, this will invalidate the window and then you'll see "before, WM_NCPAINT, after".
In Windows there are basically four low-level places where WM_NCPAINT is sent:
- In BeginPaint before anything else is done. - In GetUpdateRect/GetUpdateRgn if fErase is set to TRUE. [This is what GvG reported with the test application.] - In RedrawWindow if RDW_ERASENOW or RDW_UPDATENOW is specified. [This is what Thomas is seeing on the application startup AFICT, it comes from the ShowWindow call I'd guess.] - In DispatchMessage if WM_PAINT was sent to the application and it wasn't processed. There is an internal flag that is set before the message is passed to application and this flag is cleared by GetUpdateRect/GetUpdateRgn/BeginPaint (if appropriate) and after returning from the application it is checked. Actually this is just a hack to support broken applications, but we need to implement it anyway (and it's not implemented yet).
Actually this gets a bit trickier with the WM_SYNCPAINT messages, but since we don't use them only the places above should be assumed.
Best regards, Filip