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