Flashing windows VC interface

Source: Internet
Author: User
  • Improper updatewindow call. Windows has a low priority for the paint message to prevent unnecessary repainting of the window. However, the display calls updatewindow to force the window to be re-painted immediately, which is probably unnecessary.
  • Call invalidaterect and do not specify the update rectangle. The API function invalidaterect allows you to specify an update rectangle so that the re-painting is limited to the areas to be re-painted. You can pass a null pointer to the invalidaterect function to update the entire window, however, it takes a longer time to draw a picture, and the result is an unnecessary flashing or low-speed drawing.
  • When invalidaterect is called, the erase background parameter is not properly set to true. If you do not need to redraw the background, you can set the parameter for erasing the background in the invalidaterect function to false. Note: by default, MFC sets the parameter for background erasure to true.
  • Cs_hredraw and cs_vredraw windows are not suitable. You need to set these two window styles only when the size of the customer area needs to be re-painted. This is necessary if some elements in the window need to be placed in the center; however, most Windows do not need to be arranged in the center, so it is not necessary to use this style. By default, MFC uses these two types of styles. Therefore, if you are using MFC, it is best to remove these two attributes from the window constructor of your class.

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.