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

    Accelerator: urgent!!

    Please folks, I need to know this urgently.
    Anybody have any idea how to enable/disable
    accelerators?

    I have a CFormView derived view in my application. I have an edit box on this
    view. I am using a CEdit derived class with special processing logic for handling the WM_CHAR and WM_KEYDOWN messages for this edit box. I wish to be able to trap the key sequence CTRL + '`' + 'A' in the edit box.

    I also have an accelerator sequence of CTRL + A for the mainframe window. This is causing a conflict with the key sequence I am trapping. So
    when I hit CTRL+ '`' + 'A' with the focus in the edit box, instead of the edit class handling it, the mainframe seems to be handling it and the action associated with the accelerator is being fired. When I use a modal dialog
    instead of a CFormView, things work the way I want them to, i.e my key sequence gets executed, not the accelerator.

    How do I avoid the accelerator being fired?

    Any help, hints highly appreciated.

    Thanks,
    Chandra


  2. #2
    Join Date
    Apr 1999
    Posts
    27,449

    Re: Accelerator: urgent!!

    You need to override CWnd::PreTranslateMessage(). There is a lot of information concerning this function and handling accelerators in the MSVC on-line help.

    Regards,

    Paul McKenzie



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