MFC: How do I receive WM_KEYDOWN message in a complicated dialog
My dialog box has many different controls - buttons, list-boxes, radios etc. (but no edit controls). It is designed to be part of a hand-held device simulator (it looks like a calculator).
I have added ON_WM_KEYDOWN to my dialog's message map but all key messages are intercepted by the controls long before my dialog can deal with them.
Other than sub-classing all of these different control classes then adding ON_WM_KEYDOWN to each of their seperate message maps, is there a better way of capturing key messages?
In other words, how can I make it so that when the '6' key on my PC is pressed, my OnKeyDown method can deal with it, and when it is released, my OnKeyUp method is informed?
Many thanks for your potential help.
Andy
Re: MFC: How do I receive WM_KEYDOWN message in a complicated dialog
Quote:
In other words, how can I make it so that when the '6' key on my PC is pressed, my OnKeyDown method can deal with it, and when it is released, my OnKeyUp method is informed?
Many thanks for your potential help.
Andy
You sais that when your "6" key is pressed you want something to happen, right? do you or don't have this "6" on your dialog(iif you have it s it a button or something)?
or you want that when your app is running and the user presses "6" from the keyboard something should happen?
please, clarify this first.
Re: MFC: How do I receive WM_KEYDOWN message in a complicated dialog
Hi, sorry if this seems a little weakly related but I thought i would ask anyway. I have subclassed a window, and am intercepting the messages being passed, but what I really want to do it is intercept the messages sent to the controls on that window, how do I do that, how do i subclass them, where are they? What I really want is to be able to intercept the set text messages so that I can verify the output?
Many thanks, Ron
Re: MFC: How do I receive WM_KEYDOWN message in a complicated dialog
Quote:
Originally Posted by flavour404
Hi, sorry if this seems a little weakly related but I thought i would ask anyway. I have subclassed a window, and am intercepting the messages being passed, but what I really want to do it is intercept the messages sent to the controls on that window, how do I do that, how do i subclass them, where are they? What I really want is to be able to intercept the set text messages so that I can verify the output?
Many thanks, Ron
You should create a new question (thread) for this.
Re: MFC: How do I receive WM_KEYDOWN message in a complicated dialog
Quote:
Originally Posted by Sam Hobbs
You should create a new question (thread) for this.
I did, everybody ignored it which is why I posted under this, even though I know the link is tenuous!
Ron
Re: MFC: How do I receive WM_KEYDOWN message in a complicated dialog
Quote:
Originally Posted by Sam Hobbs
You should create a new question (thread) for this.
I did, everybody ignored it which is why I posted under this, even though I know the link is tenuous!
Ron