执行语句 (CMDIFrameWnd*)pMainFrame->UpdateWindow() 后,是先发 WM_PAINT 消息还是 OnDraw 消息?也就是说,是先执行OnDraw 还是先执行 OnPaint 函数?还是只执行其中一个函数?
问题点数:50、回复次数:7Top
1 楼hsdly()回复于 2001-09-26 11:44:09 得分 0
你可以写提示框试一下!Top
2 楼Belle(不会游泳的鱼....)回复于 2001-09-26 12:24:40 得分 20
我认为执行OnPaint 函数
onpaint会调用ondraw
///////
CWnd::UpdateWindow
void UpdateWindow( );
Remarks
Updates the client area by sending aWM_PAINT message if the update region is not empty. The UpdateWindow member function sends a WM_PAINT message directly, bypassing the application queue. If the update region is empty, WM_PAINT is not sent.
Top
3 楼Belle(不会游泳的鱼....)回复于 2001-09-26 12:29:16 得分 0
参考:http://www.csdn.net/expert/topicview1.aspTop
4 楼chenzhou35(vcworm.51.net)回复于 2001-09-26 12:52:29 得分 15
先调OnPaint(),以下是MFC的源码,可以看到在OnPaint()里直接调用了OnDraw
void CView::OnPaint()
{
// standard paint routine
CPaintDC dc(this);
OnPrepareDC(&dc);
OnDraw(&dc);
}Top
5 楼voidman()回复于 2001-09-26 13:34:05 得分 15
View的OnPaint里会调用OnDraw,如果你重载不调,OnDraw就不执行了Top
6 楼li_yirong(lyr)回复于 2001-09-26 14:10:57 得分 0
感谢 chenzhou35(chenzhou35) Belle(不会游泳的鱼....) Belle(不会游泳的鱼....)
的帮助!Top
7 楼bighead(bighead1997)回复于 2001-09-26 19:12:11 得分 0
妹子,有OnDraw消息吗?
是WM_PAINT,执行OnPaint,OnPaint调用OnDrawTop




