重写CDialog类的以下函数
BOOL CGraphicsDlg::PreTranslateMessage(MSG* pMsg)
{
if(pMsg->message == WM_CHAR || pMsg->message == WM_KEYDOWN) //此处判断WM_CHAR消息
{
this->SendMessage(pMsg->message, pMsg->wParam, pMsg->lParam); //此处向对话框发送WM_CHAR消息
return TRUE;
}//要在对话框中添加WM_CHAR在响应函数return CDialog::PreTranslateMessage(pMsg);
}