본문 바로가기

카테고리 없음

CDialog esc 안먹히게 하기

PreTranslateMessage 함수를 오버라이드해서 Contorl이 가능합니다

ECS 키 뿐만 아니라 다른 키도 제어 할수 있습니다

 

BOOL CUserDialog::PreTranslateMessage(MSG* pMsg)

{

     if( pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_ESCAPE )// ESC 키를 누를 경우

     {

          return TRUE;

     }

// 아니면 다음을 수행

     return CDialog::PreTranslateMessage(pMsg);

}