Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. capture wm_char message

capture wm_char message

Scheduled Pinned Locked Moved C / C++ / MFC
questionlearning
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    lucy 0
    wrote on last edited by
    #1

    I have a CFormview based SDI application. On the formview, I have a property sheet displayed, which has quite some edit controls. Although I have specified accelerator keys in the resource, the program never respond to any key press. So I am thinking of CMyView::PreTranslateMessage, then CMyView::WindowProc, but neither of them can capture wm_char message when I pressed any key when the edit control on property page is having the input focus. what can I do? Thanks a lot!

    K 1 Reply Last reply
    0
    • L lucy 0

      I have a CFormview based SDI application. On the formview, I have a property sheet displayed, which has quite some edit controls. Although I have specified accelerator keys in the resource, the program never respond to any key press. So I am thinking of CMyView::PreTranslateMessage, then CMyView::WindowProc, but neither of them can capture wm_char message when I pressed any key when the edit control on property page is having the input focus. what can I do? Thanks a lot!

      K Offline
      K Offline
      Kuniva
      wrote on last edited by
      #2

      It's just a guess, i don't use the MFC framework, but don't the WM_CHAR messages only get sent to the actual edit window? Try using GetWindow() to get the handle of the edit control, and then run a loop using GetMessage() to get the first message in the message queu. Then check it for WM_CHAR and ... It's just a guess though, there's probably an easier way :-D Kuniva --------------------------------------------

      L 1 Reply Last reply
      0
      • K Kuniva

        It's just a guess, i don't use the MFC framework, but don't the WM_CHAR messages only get sent to the actual edit window? Try using GetWindow() to get the handle of the edit control, and then run a loop using GetMessage() to get the first message in the message queu. Then check it for WM_CHAR and ... It's just a guess though, there's probably an easier way :-D Kuniva --------------------------------------------

        L Offline
        L Offline
        lucy 0
        wrote on last edited by
        #3

        I am not sure. But in one article Nish wrote, you can use PreTranslateMessage to capture wm_keydown or other messages by the dialog instead of having it processed by the control which have the input focus. I think I should be able to do the same in my app. but :(( The GetWindow() would be a messy one in my case even it works, since I have hundreds of edit controls. any other hint?:confused:

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups