响应onmousemove之前先执行自己的函数
思路如下:
界面上有个button1
1,我想在不重新编写控件的情况下,增加一个控件辅助类比如buttonhelp
2,将button1对象传给buttonhelp;
button1->onmousemove 赋值为 buttonhelp:: mousemove 方法
3,在窗口中编写 button1的响应代码button1::onmousemove
我在button1在触发 鼠标移动事件时,先执行button::mousemove 方法,在执行button1::onmousemove方法如下代码所示
class buttonhelp
{
buttonhelp(object *button)
{
button->onmousemove =mousemove;
}
mousemove(object* sender)
{
int i = 1;
}
}
//响应窗口消息处理
public TestDlg::button1onmousemove(object* sender)
{
//不想直接调用方法,不管用户是否响应了鼠标移动事件,在button1onmousemove是否编写了代码
// 我都想先执行button1::onmousemove(sender);再执行button1onmousemove
//button1::onmousemove(sender);
}