Dialog 에서 Enter, ESC 키 처리 프로그래밍

1. 메시지 처리하는 방식

BOOL CManagerClientDlg::PreTranslateMessage(MSG* pMsg) 
{
  if (pMsg->message == WM_KEYDOWN) {
        if (pMsg->wParam == VK_RETURN || pMsg->wParam == VK_ESCAPE) {
      // VK_RETURN  : Enter Key
      // VK_ESCAPE  : ESC key
            
      return TRUE;
        }
    }
  
  return CDialog::PreTranslateMessage(pMsg);
}


2. 이벤트 처리 방식
Enter Key : OnOK 함수 오버라이딩
ESC Key : OnCancel 함수 오버라이딩


편한데로 상황에 맞게 쓰면 될듯.

트랙백

이 글과 관련된 글 쓰기 (트랙백 보내기)
TrackbackURL : http://sondra.egloos.com/tb/5561733 [도움말]

덧글

댓글 입력 영역