One-day Windows API (2)-invalidaterect Function

Source: Internet
Author: User

 

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.