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. enabling keyboard shortcuts in my application

enabling keyboard shortcuts in my application

Scheduled Pinned Locked Moved C / C++ / MFC
question
4 Posts 4 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.
  • V Offline
    V Offline
    VCProgrammer
    wrote on last edited by
    #1

    Hi all, I have made a dialog based application in vc2008, i want to enable some keyboard shortcuts in my application like i have displayed a message box on button click event and if i press b that same dialog box should be displayed.... how can i do this??? Thanks in advance

    A M R 3 Replies Last reply
    0
    • V VCProgrammer

      Hi all, I have made a dialog based application in vc2008, i want to enable some keyboard shortcuts in my application like i have displayed a message box on button click event and if i press b that same dialog box should be displayed.... how can i do this??? Thanks in advance

      A Offline
      A Offline
      Arman S
      wrote on last edited by
      #2

      To handle key pressings in dialogs, one should override PreTranslateMessage. It's MSG argument has the necessary information about pressed keys.

      -- Arman

      1 Reply Last reply
      0
      • V VCProgrammer

        Hi all, I have made a dialog based application in vc2008, i want to enable some keyboard shortcuts in my application like i have displayed a message box on button click event and if i press b that same dialog box should be displayed.... how can i do this??? Thanks in advance

        M Offline
        M Offline
        Madhu Nair 0
        wrote on last edited by
        #3

        Add the ampersand [&] symbol before the desired letter in the button caption. For e.g for &Click, if you press Alt + C will run the code for Click button.

        1 Reply Last reply
        0
        • V VCProgrammer

          Hi all, I have made a dialog based application in vc2008, i want to enable some keyboard shortcuts in my application like i have displayed a message box on button click event and if i press b that same dialog box should be displayed.... how can i do this??? Thanks in advance

          R Offline
          R Offline
          Rajesh R Subramanian
          wrote on last edited by
          #4

          Hi, See Keyboard messages/accelerators handling in a dialog based applciation[^]

          It is a crappy thing, but it's life -^ Carlo Pallini

          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