2009年11月25日 星期三

CWnd::OnPaint

OnPaint function在接收到系統所發出的WM_PAINT就會執行到(是因為MFC是用message pass的方式)

Windows會發送此訊息
From Embedded Visual C++ Version 4.0
An internal WM_PAINT message is sent only once by Windows

此外也可以透過UpdateWindow去呼叫到OnPaint
After an internal WM_PAINT message is sent to a window by the UpdateWindow method,no further WM_PAINT messages will be sent or posted until the window is invalidated or until the RedrawWindow method is called again with the RDW_INTERNALPAINT flag set.

此外
該文章
也有對Onpaint, Invalidate, Updatewindows做一番解釋

透過Facebook分享

沒有留言: