프로그래밍/VC++

에디트박스에서 엔터키를 누르면 어떤 처리를 하도록.

panpro 2007. 6. 12. 02:01

BOOL CYakdoDlg::PreTranslateMessage(MSG* pMsg)
{
 // TODO: 여기에 특수화된 코드를 추가 및/또는 기본 클래스를 호출합니다.
 if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_ESCAPE)
    {  
        return TRUE;
    }

 if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RETURN)
    {  
  CWnd *pWnd = this->GetFocus();
  if ( pWnd == GetDlgItem(IDC_EDTSANGHO))
  {
   OnBnClickedBtnsearch();
   return TRUE;
  }
  else
   return TRUE;
    }

 return CDialog::PreTranslateMessage(pMsg);
}