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. OnkeyDown in dialog

OnkeyDown in dialog

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

    hi, have a dialog based application in which i would like to capture the OnKetDown event...but inspite of mapping it thru the Class Wizard ...it doesnt seem to work... what is the reason..... Satadru.

    M 1 Reply Last reply
    0
    • S satadru

      hi, have a dialog based application in which i would like to capture the OnKetDown event...but inspite of mapping it thru the Class Wizard ...it doesnt seem to work... what is the reason..... Satadru.

      M Offline
      M Offline
      Monty2
      wrote on last edited by
      #2

      try PreTranslateMessage Live as if your were to die tomorrow. Learn as if you were to live forever. -Mahatma Gandhi

      S 1 Reply Last reply
      0
      • M Monty2

        try PreTranslateMessage Live as if your were to die tomorrow. Learn as if you were to live forever. -Mahatma Gandhi

        S Offline
        S Offline
        satadru
        wrote on last edited by
        #3

        i tried thid but didnt work: BOOL ControlDialog::PreTranslateMessage(MSG* pMsg) { if (pMsg->message==WM_KEYDOWN) { MessageBox("I did it!"); } return CDialog::PreTranslateMessage(pMsg); }

        Z 1 Reply Last reply
        0
        • S satadru

          i tried thid but didnt work: BOOL ControlDialog::PreTranslateMessage(MSG* pMsg) { if (pMsg->message==WM_KEYDOWN) { MessageBox("I did it!"); } return CDialog::PreTranslateMessage(pMsg); }

          Z Offline
          Z Offline
          zeki yugnak
          wrote on last edited by
          #4

          hi.. You can use like that..

          BOOL CYourDlg::PreTranslateMessage(MSG* pMsg)
          {
          // TODO: Add your specialized code here and/or call the base class
          if(pMsg->message==WM_KEYDOWN)
          {
          UINT nChar=(UINT)pMsg->wParam;
          if(nChar==VK_UP )
          {
          //What you want to do......
          }
          }
          return CDialog::PreTranslateMessage(pMsg);
          }

          good luck....:)

          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