This message is posted to a window when painting is required.



The parameters are unused.



If the window processes this message, it should return zero.


The default window procedure validates the update region of the window. The default window procedure generates a non-client paint message when the frame requires updating and a background erase message when the background requires repainting.

The function UpdateWindow causes this message to be generated. The function RedrawWindow also causes this message to be generated.

This message is also generated and placed in the thread's message queue when the operating system determines that the window requires repainting (but only when there are no other messages in the queue). The paint message is retrieved by function GetMessage only when there are no other messages in the queue (that is, with the lowest message priority).

Internal paint messages may be generated via the function RedrawWindow using flag RedrawInternalPaint. Such messages may have no associated update region, in which case, the operator GetUpdateRectangle may be used to obtain the update rectangle. If no update rectangle exists, no painting should be attempted.