how to overide onchar in dialogbased application
hai folks,
I am creating a dialog based application. I am overiding(WM_CHAR) On Char()
member function. But that function is not fired when a press a character
I have also tried with accelerator resources also. There also the same
result. Please any one help me to solve the problem. Its very urgent.
regards,
kalyan
Re: how to overide onchar in dialogbased application
The OnChar-Message is send to the childwnd that has the focus and that's why you don't get it in the Dialog.
Mike
Re: how to overide onchar in dialogbased application
hai,
Refering to your Ques about OnChar()in dialog.
I think u can't catch OnChar() directly in dlg application.
u do the following..
override virtual PreTranslateMessage
BOOL CMyDialog::PreTranslateMessage(MSG* pMsg)
{
if(pMsg->message==WM_CHAR)
{
AfxMessageBox("RAJJU");
}
return CDialog::PreTranslateMessage(pMsg);
}
remove message box and do what u want .
If u get a better solution ps mail to [email protected]
bye ....
sriram
Re: how to overide onchar in dialogbased application
if it gets to complicated, use a CFormView based application...
chrislaw