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. CListCtrl OnKeyDown message.

CListCtrl OnKeyDown message.

Scheduled Pinned Locked Moved C / C++ / MFC
c++databasedebugginghelpquestion
4 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.
  • F Offline
    F Offline
    Fred dB
    wrote on last edited by
    #1

    Hello, I have problem with a CListCtrl. As you know, pushing up/bottom arrow allow you to move up and down through the elements of your list (it's builtin). Everything was perfect since yesterday :) I noticed that the arrows didn't respond. A message (WM_KEYDOWN) seems to be blocked by something but i can't put the finger on it. Mouse events work perfectly. I derived a class from CListCtrl and i put it in a form derived from CFormView. As i said,all was working perfectly two days ago. The problem seems to be simple, i do not use special or custom code to process messages. I think i respect the way to implement controls using MFC. Any tips to locate simply (with VC debugger) where the problem is? Thank u! Fred C++/MFC/SQL Developer.

    S 1 Reply Last reply
    0
    • F Fred dB

      Hello, I have problem with a CListCtrl. As you know, pushing up/bottom arrow allow you to move up and down through the elements of your list (it's builtin). Everything was perfect since yesterday :) I noticed that the arrows didn't respond. A message (WM_KEYDOWN) seems to be blocked by something but i can't put the finger on it. Mouse events work perfectly. I derived a class from CListCtrl and i put it in a form derived from CFormView. As i said,all was working perfectly two days ago. The problem seems to be simple, i do not use special or custom code to process messages. I think i respect the way to implement controls using MFC. Any tips to locate simply (with VC debugger) where the problem is? Thank u! Fred C++/MFC/SQL Developer.

      S Offline
      S Offline
      Scot Brennecke
      wrote on last edited by
      #2

      I'm not sure what differences you have between now and two days ago, but it sounds like you're being bitten by IsDialogMessage. Certain keystrokes are trapped by the system and treated as dialog navigation keys, rather than being sent to the control. Besides direction keys, this also includes things like Tab. Try adding a handler for WM_GETDLGCODE to your control. Return DLGC_WANTARROWS. Scot Brennecke Software Developer VC++ MVP

      F 1 Reply Last reply
      0
      • S Scot Brennecke

        I'm not sure what differences you have between now and two days ago, but it sounds like you're being bitten by IsDialogMessage. Certain keystrokes are trapped by the system and treated as dialog navigation keys, rather than being sent to the control. Besides direction keys, this also includes things like Tab. Try adding a handler for WM_GETDLGCODE to your control. Return DLGC_WANTARROWS. Scot Brennecke Software Developer VC++ MVP

        F Offline
        F Offline
        Fred dB
        wrote on last edited by
        #3

        Thank you, I try immediately. Fred

        F 1 Reply Last reply
        0
        • F Fred dB

          Thank you, I try immediately. Fred

          F Offline
          F Offline
          Fred dB
          wrote on last edited by
          #4

          Scot, First,thank you to pay attention at my problem!. I noticed, after you answered me, that any controls trough the application get messages (concerning keystrokes). I implemented what you adviced me everywhere in my controls but never i entered in the fucntion OnGetDlgCode ... afx_msg UINT OnGetDlgCode( ); ON_WM_CREATE() UINT Cxxx::OnGetDlgCode() { return Cxxx::OnGetDlgCode() | DLGC_WANTARROWS | DLGC_WANTTAB; } It's a very weird situation. Anyway thanks for your help. Frédéric. Fred C++/MFC/SQL developer

          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