Windows mobile设置MFC确认键不退出及OnExit响应退出

BOOL CtestDlg::PreTranslateMessage(MSG* pMsg)
{
    // TODO: Add your specialized code here and/or call the base class
    if((pMsg->message==WM_KEYDOWN) && (pMsg->wParam==VK_RETURN))
                return TRUE;
    return CDialog::PreTranslateMessage(pMsg);
} 
void CtestDlg::OnExit()
{
	// TODO: 在此添加命令处理程序代码
	AfxGetMainWnd()->SendMessage(WM_CLOSE);
}
原文地址:https://www.cnblogs.com/lartely/p/1995147.html