Escape Key

This is a discussion on Escape Key within the Windows Programming forums, part of the Platform Specific Boards category; How can I detect when the Escape Key has been pressed when the focus is set to a child window, ...

  1. #1
    Registered User mrafcho001's Avatar
    Join Date
    Jan 2005
    Posts
    483

    Escape Key

    How can I detect when the Escape Key has been pressed when the focus is set to a child window, in my case an Edit Control?

    I've tried WM_KEYDOWN and WM_CHAR but once the user starts typing in the edit box, the WM_KEYDOWN and WM_CHAR messages dont seem to be generated? or at least not to the main window.
    My Website
    010000110010101100101011
    Add Color To Your Code!

  2. #2
    Bioport Productions
    Join Date
    Oct 2005
    Posts
    215
    Unfortunately, you can't get that data from the child window. You will need to override the control and subclass it to the child window. Then you can parse messages in the PreTranslateMessage function in your overrided control.
    -"What we wish, we readily believe, and what we ourselves think, we imagine others think also."
    PHP Code:
    sadf 

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 16
    Last Post: 11-23-2007, 12:48 PM
  2. Virtual keys
    By Arkanos in forum Windows Programming
    Replies: 4
    Last Post: 12-12-2005, 09:00 AM
  3. Directional Keys - Useing in Console
    By RoD in forum C++ Programming
    Replies: 38
    Last Post: 10-06-2002, 04:42 PM
  4. FAQ: Directional Keys - Useing in Console
    By RoD in forum FAQ Board
    Replies: 38
    Last Post: 10-06-2002, 04:42 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21