We can use the Invalidate in the WM_PAINT.
- | call | Invalidate flag | after invalidate | no | - | - | - |
- | WM_PAINT | check_invalidate=1; | WM_PAINT | 1 | |||
- | WM_KEYUP | check_invalidate=1; | WM_PAINT | 2 | |||
- | 3 | ||||||
WM_KEYUP | check_invalidate=1; | WM_PAINT | 4 | ||||
-> | WM_PAINT | check_invalidate=1 | WM_PAINT | 5 | |||
-> | WM_PAINT | check_invalidate=1; | WM_PAINT | 6 | |||
- |
We can animate the window in the call of WM_PAINT in the windows thread itself.
(20220402)
We can not call any thread after keyup and paint if we flag check_invalidate=1 in the case of paint like no.6 in raw.
(20220402)
So, we can use validate for the after keyup like the below as replacement of Invalidate.
*
Validate is for the pain so that we can not imagine that it is not used for any other paint.
And it is written like that "The system continues to generate WM_PAINT messages until the current update region is validated."
Continue and current are in only WM_PAINT.
InvalidateRect:
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-invalidaterect
[in] lpRect
... is NULL, the entire client area is added to the update region.