去掉默認回車關閉的方法
睿豐德科技 專注RFID識別技術和條碼識別技術與管理軟件的集成項目。質量追溯系統、MES系統、金蝶與條碼系統對接、用友與條碼系統對接
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);
}