文章见http://msdn.microsoft.com/msdnmag/issues/01/11/c/
我碰到了与提问者同样的问题,“The problem is that mouse messages go to the control and cannot be overridden in the view.” 但是用Paul DiLascia的方法解决不了问题,所有的鼠标消息都被custom control 截获,view里面根本就触发不了任何鼠标消息,难道是因为我的
custom control 里使用了OnLButtonDown消息?那好,我试着把试着把custom control 里的鼠标消息屏蔽,view里面还是触发不了任何鼠标消息,郁闷中,期望牛人予以解答
我碰到了与提问者同样的问题,“The problem is that mouse messages go to the control and cannot be overridden in the view.” 但是用Paul DiLascia的方法解决不了问题,所有的鼠标消息都被custom control 截获,view里面根本就触发不了任何鼠标消息,难道是因为我的
custom control 里使用了OnLButtonDown消息?那好,我试着把试着把custom control 里的鼠标消息屏蔽,view里面还是触发不了任何鼠标消息,郁闷中,期望牛人予以解答
参考文章中下面的段落
if your custom control view class is not a pure wrapper function, that is, if it has so much as one data member or virtual function of its own, then the way to convert your control into a view is to instantiate it as a child window of the view and integrate it in three simple steps.Handle WM_SIZE in the view to position your control exactly over the view's client area.Convert mouse messages in the control to higher-level parent WM_NOTIFY notifications.Handle WM_SETFOCUS in the view to set focus to your control
“Convert mouse messages in the control to higher-level parent WM_NOTIFY notifications”,就是这句话我看不懂,如果“Convert”是转变的意思,它是指把所有的WM_Command事件用WM_NOTIFY代替,那我都把custom control 里的鼠标消息屏蔽掉了,还是触发不了view的鼠标消息。如果“Convert”是转发的意思,请问蒋老大如何去做?
|
|
|
有个人技术网站吗?请问网址?
你有邮箱吗?我的[email protected]
你有qq吗?我的:84168964哦,好像不止三个问题了