Windows program design Note 6

Source: Internet
Author: User

1. Before winmain enters the loop, there will usually be an updatewindow to deliver the wm_paint message to the window process.
2. events that trigger the wm_paint message: the hidden windows are re-visible; the window size is changed; scrollwindow or scrolldc is rolling to the customer area; the invalidrect or invalidrgn displays the wm_paint message; validate cancels wm_paint.
3. The program should be organized to retain all the information required to draw the customer zone.
4. Understanding of invalid and valid regions in the customer zone. When wm_paint is processed, you can use getupdaterect to obtain coordinates of invalid regions.
5. The device description table is always related to a specific window on the display.
6. wm_erasebkgnd processes the erasure of invalid areas and fills the invalid areas with the brush attribute in wndclass. hbrbackground.
7. paintstruct structure.
8. invalidaterect (hwnd, null, true) invalidates the entire customer zone and erased the background. If the last parameter is set to false, the background is not erased.
9. How to obtain the device description table:
1) HDC = beginpaint (hwnd, & PS );
Endpaint (hwnd, & PS); this method draws images only in the invalid Area
2) HDC = getdc (hwnd );
Releasedc (hwnd, HDC); this method can be used to draw images in any area of the client without making them invalid or valid.
Getwindowdc: Return to the device description table of the entire window and modify the window title.

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.