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

    How do I understand PreTranslateMessage

    My intention is to intercept some messages and to determine if it should be dispatched to window.
    Then I chose PreTranslateMessage.

    Still I'm a little suspicious if I got it right,
    1. does PreTranslateMessage work for entire application, which means, it doesn't work for per window, instead, it works in application scope
    2. is PreTranslateMessage my correct solution, I've read somewhere which offered another solution, which is better?
    Here's the post, http://blogs.msdn.com/oldnewthing/ar...7/3555596.aspx

    thx in advance

  2. #2
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,637

    Re: How do I understand PreTranslateMessage

    MSDN answers number 1. There's a PreTranslateMessage for the app class and for each CWnd.

    Number 2 depends on the problem.

  3. #3
    Join Date
    Dec 2005
    Posts
    52

    Re: How do I understand PreTranslateMessage

    Quote Originally Posted by GCDEF View Post
    MSDN answers number 1. There's a PreTranslateMessage for the app class and for each CWnd.

    Number 2 depends on the problem.
    So PreTranslateMessage for app class gets higher priority than which for each CWnd, right?
    Suppose that I write a PreTranslateMessage for app class and a PreTranslateMessage for one CWnd, they will work together?

    In other word, if I write a PreTranslateMessage for certain CWnd, it only applies to all messages which are supposed to be dispatched to this CWnd, right?

    The description in MSDN is quite opaque...
    Last edited by LifeIsSuffering; April 2nd, 2010 at 12:41 AM.

  4. #4
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,633

    Re: How do I understand PreTranslateMessage

    The article to make it transparent...
    Best regards,
    Igor

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