您的位置:首页 > 其它

为手工添加MFC PreTranslateMessage 重载

2010-06-06 23:31 323 查看
在头文件中加

public:
virtual BOOL PreTranslateMessage(MSG* pMsg);

然后在cpp 文件中重写

BOOL CGetcwndDlg::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
if (pMsg->message==WM_MOUSEMOVE)
{
CPoint point(LOWORD(pMsg->lParam),HIWORD(pMsg->lParam));
OnMouseMove(0,point);
}
return CDialog::PreTranslateMessage(pMsg);
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: