what is invalidate,update methods do in VC++

后端 未结 2 1955
悲&欢浪女
悲&欢浪女 2020-12-29 14:50

i have small doubt regarding the window functions in c++. what exactly \"invalidate()\" function do? what message does it sends?when we need to call this? also

2条回答
  •  轮回少年
    2020-12-29 15:35

    CWnd::Invalidate() invalidates the entire client area of a window, which indicates that the area is out of date, and should be repainted. You would typically call this on a control that needs to be redrawn. CWnd::InvalidateRect() invalidates only part of the window.

    With the Invalidate functions, the WM_PAINT message will posted [not strictly true; see the comments] to the message queue and handled at some point in the future. CWnd::UpdateWindow() sends (as opposed to posts) a WM_PAINT message, causing the invalidated regions to be redrawn immediately.

    Really, this is all in the docs.

提交回复
热议问题