1 最简单的办法:添加一个不可见的按钮,设为对话框的默认按钮即可


2 重载对话框的PreTranslateMessage消息处理
BOOL CSIMDlg::PreTranslateMessage(MSG* pMsg)  
{
 // TODO: Add your specialized code here and/or call the base class
 if( pMsg->message ==WM_KEYDOWN)
 {
  if(pMsg->wParam == VK_ESCAPE||pMsg->wParam == VK_RETURN)
  return TRUE;
 }
 return CDialog::PreTranslateMessage(pMsg);
}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-05-27
  • 2022-02-07
  • 2022-12-23
  • 2022-12-23
  • 2021-08-03
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-26
相关资源
相似解决方案