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.