OnkeyDown in dialog
-
hi, have a dialog based application in which i would like to capture the OnKetDown event...but inspite of mapping it thru the Class Wizard ...it doesnt seem to work... what is the reason..... Satadru.
-
try PreTranslateMessage Live as if your were to die tomorrow. Learn as if you were to live forever. -Mahatma Gandhi
-
i tried thid but didnt work: BOOL ControlDialog::PreTranslateMessage(MSG* pMsg) { if (pMsg->message==WM_KEYDOWN) { MessageBox("I did it!"); } return CDialog::PreTranslateMessage(pMsg); }
hi.. You can use like that..
BOOL CYourDlg::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
if(pMsg->message==WM_KEYDOWN)
{
UINT nChar=(UINT)pMsg->wParam;
if(nChar==VK_UP )
{
//What you want to do......
}
}
return CDialog::PreTranslateMessage(pMsg);
}good luck....:)