Click to See Complete Forum and Search --> : how to overide onchar in dialogbased application


satish
March 31st, 1999, 05:25 AM
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

Mike Wild
April 13th, 1999, 03:48 AM
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

April 13th, 1999, 07:47 AM
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 sriram_kosuri@hotmail.com

bye ....
sriram

chris law
April 14th, 1999, 03:01 AM
if it gets to complicated, use a CFormView based application...

chrislaw