Click to See Complete Forum and Search --> : Dialog based


April 21st, 1999, 05:59 AM
hai ,

How do i trap the characters of the keyboard in a dialog based application.

I had tried WM-CHAR,WM_KEYDOWN,WM_KEYUP,WM_KEYPRESS,PreTransalateMessage

Its not working. Please help me


satish

April 21st, 1999, 06:41 AM
Normally PreTranslateMessage works well

Try this :

BOOL CTestDlg::PreTranslateMessage(MSG* pMsg)
{
if ( pMsg->message == WM_KEYDOWN || pMsg->message == WM_SYSKEYDOWN)
{
// To have information about key see WM_KEYDOWN message in help files
// Note that pMsg->wParam contains the virtual key code
}

return CDialog::PreTranslateMessage(pMsg);
}

April 21st, 1999, 07:43 AM
thanks Anonymous

Its working after i do the filtering part.

satish