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. Trapping keystrokes in dialog

Trapping keystrokes in dialog

Scheduled Pinned Locked Moved C / C++ / MFC
3 Posts 3 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.
  • D Offline
    D Offline
    dart13
    wrote on last edited by
    #1

    Can somebody please explain what I have to do in order to have CButton controls on dialog respond to WM_CHAR messages (and not to use PreTranslateMessage() ). I tried to put OnChar() in my instance of CDialog with classWizard but the dialog just beeps when I press keys.

    P D 2 Replies Last reply
    0
    • D dart13

      Can somebody please explain what I have to do in order to have CButton controls on dialog respond to WM_CHAR messages (and not to use PreTranslateMessage() ). I tried to put OnChar() in my instance of CDialog with classWizard but the dialog just beeps when I press keys.

      P Offline
      P Offline
      Prakash Nadar
      wrote on last edited by
      #2

      Are you talking about shortcut keys ? did ya try putting '&' before one of the char in the dialog button text ?


      God is Real, unless declared Integer.

      1 Reply Last reply
      0
      • D dart13

        Can somebody please explain what I have to do in order to have CButton controls on dialog respond to WM_CHAR messages (and not to use PreTranslateMessage() ). I tried to put OnChar() in my instance of CDialog with classWizard but the dialog just beeps when I press keys.

        D Offline
        D Offline
        dudepdx
        wrote on last edited by
        #3

        Did you try it by subclassing cbutton.....you should derive your own class(CMyButton) from CButton and use CMyButton on your dialog box instead of CButton and then add the messagemap for WM_CHAR ...it will work... cheers

        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