InvalidaterectFunction
This function adds an area to the update area of the specified window. The update area represents a part of the window client, which must be redrawn.
bool invalidaterect (
hwnd hwnd ,
const rect * lprect ,
Bool Berase
);
Parameters:
Hwnd
Point to the window handle to be re-drawn. If this parameter is blank, the system updates and redraws all windows, and sends wm_erasebkgnd to the window before the function returns.
Lprect
A structure pointing to rect that contains the coordinates of the rectangular area to be added to the update area. If this parameter is null, the entire client region is added to the update region.
Berase
This parameter is boolean. Specifies whether the background of the update area is erased when the update area is re-drawn.
Return Value
If the function is successfully executed, the return value is non-zero. If the function fails, the return value is zero. To obtain more error information, call getlasterror ();
Notes
The hwnd parameter cannot be null.
The invalid region is not updated immediately. On the contrary, it is "accumulated" in the update region until the next wm_paint message occurs or the region has been updated by the validaterect function.
When the applicationProgramWhen there are no other messages in the queue and the update region is not empty, the system will send the wm_painta message to the window. If the value of berase is true, the entire background is erased, not the specified region.
A programming navigation network www.code250.com is recommended.