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);
}
{
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 함수 오버라이딩
편한데로 상황에 맞게 쓰면 될듯.



덧글