9/24/2016

다이얼로그 기반 프로그램에서 Enter Key와 ESC Key로 인한 프로그램 종료 방지

다이얼로그 기반 프로그램에서 Enter Key와 ESC Key로 인한 프로그램 종료 방지


Class Wizard(CTRL+SHIFT+X) 
해당 dialog를 선택한 후 가상함수에서 PreTranslateMessage 함수를 생성한다.

BOOL LensSpec::PreTranslateMessage(MSG* pMsg)
{
if(pMsg->wParam == VK_RETURN || pMsg->wParam == VK_ESCAPE) return TRUE;


return CDialog::PreTranslateMessage(pMsg);
}