|
InvalidatedRect
To invalidate a rectangle, the rectangle needs to be redrawn, and a redraw mark is made on the rectangle. When the next WM_PAINT is issued, the rectangle is redrawn.
Make the display rectangular area invalid, WM_PAINT will redraw the invalid area
The parameter TRUE in the function means that the system will cover the selected area with the background color once before you draw. The default background color is white. You can change the background color by setting BRUSH.
UpdateWindow
Force a WM_PAINT message
Will send a WM_PAINT, but do not enter the message queue, call to update the window immediately
Only send WM_PAINT message to the form, before sending, judge GetUpdateRect(hWnd,NULL,TRUE) to see if there is a client area that can be drawn, if not, don’t send WM_PAINT
If you want to refresh the invalid area immediately, you can call UpdateWindow after calling InvalidateRect. If any part of the client area is invalid,
Then UpdateWindow will cause Windows to call the window procedure with the WM_PAINT message (if the entire client area is valid, the window procedure is not called).
This WM_PAINT message does not enter the message queue, and the window procedure is directly called by WINDOWS. Exit immediately after the window process is refreshed,
WINDOWS returns control to the statement after the UpdateWindow call in the program. |
|