CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 1999
    Posts
    62

    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

  2. #2
    Join Date
    Apr 1999
    Posts
    43

    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


  3. #3
    Guest

    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



  4. #4
    Join Date
    May 1999
    Posts
    69

    Re: how to overide onchar in dialogbased application

    if it gets to complicated, use a CFormView based application...

    chrislaw

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured