在类向导自动为对话框添加PreTranslateMessage(MSG* pMsg)函数;
BOOL CjilutestDlg::PreTranslateMessage(MSG* pMsg)
{
// TODO: 在此添加专用代码和/或调用基类
if (pMsg->message == WM_LBUTTONDOWN )
{
CButton *pbutton = (CButton*)GetDlgItem(IDC_BUTTON1);
if (pMsg->hwnd == pbutton->GetSafeHwnd())
{
//按钮动作记录
}
}
if (pMsg->message == WM_LBUTTONDOWN)
{
CEdit *pedit = (CEdit*)GetDlgItem(IDC_EDIT1);
if (pMsg->hwnd == pedit->GetSafeHwnd())
{
//编辑框进行的动作记录
}
}
return CDialogEx::PreTranslateMessage(pMsg);
}