1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| BOOL CLaClasse::PreTranslateMessage(MSG* pMsg)
{
CWnd *pWnd;
if (pMsg->message == WM_KEYDOWN)
{
switch(pMsg->wParam)
{
case VK_UP :
pWnd=GetNextDlgTabItem(GetFocus());
if(pWnd) pWnd->SetFocus();
return TRUE;
break;
case VK_DOWN :
pWnd=GetNextDlgTabItem(GetFocus(),TRUE);
if(pWnd) pWnd->SetFocus();
return TRUE;
break;
case VK_RETURN :
pWnd=CWnd ::GetFocus();
if(pWnd)
{
if (pWnd->GetDlgCtrlID( )==IDC_BUTTON_INIT_VALIDE)
{}
else if (pWnd->GetDlgCtrlID( )==IDC_BUTTON_INIT_ANNULER)
{
EndDialog(IDCANCEL);
}
else
{
this->PrevDlgCtrl();
return FALSE;
}
}
break;
default:
break;
}
}
return CDialog::PreTranslateMessage(pMsg);
} |
Partager