Routing Enter/Return key press to a Dialog
-
Hey I have a MFC dialog app that will process the Enter/Return key presses in the keyboard. Now if the dialog is minimized or hidden behind some other window, it will not be able to process the Return key presses. Which makes sense considering the keyboard messages are routed to the window with focus. I want to route all Return/Enter key presses to my MFC dialog irrespective of whether its hidden or minimized. Is there a way i can do that? Thanks in advance.
-
Hey I have a MFC dialog app that will process the Enter/Return key presses in the keyboard. Now if the dialog is minimized or hidden behind some other window, it will not be able to process the Return key presses. Which makes sense considering the keyboard messages are routed to the window with focus. I want to route all Return/Enter key presses to my MFC dialog irrespective of whether its hidden or minimized. Is there a way i can do that? Thanks in advance.
Use Keyboard hooks.
-
Hey I have a MFC dialog app that will process the Enter/Return key presses in the keyboard. Now if the dialog is minimized or hidden behind some other window, it will not be able to process the Return key presses. Which makes sense considering the keyboard messages are routed to the window with focus. I want to route all Return/Enter key presses to my MFC dialog irrespective of whether its hidden or minimized. Is there a way i can do that? Thanks in advance.
Are you sure you want to do this? ...this sounds like it would create a headache for your users...
-
Use Keyboard hooks.
-
Hey I have a MFC dialog app that will process the Enter/Return key presses in the keyboard. Now if the dialog is minimized or hidden behind some other window, it will not be able to process the Return key presses. Which makes sense considering the keyboard messages are routed to the window with focus. I want to route all Return/Enter key presses to my MFC dialog irrespective of whether its hidden or minimized. Is there a way i can do that? Thanks in advance.
dipuks wrote:
I want to route all Return/Enter key presses to my MFC dialog irrespective of whether its hidden or minimized.
Is there a way i can do that?Why would you want/need to do this? After capturing them, are you planning on passing those keystrokes on so that the window with focus will behave as expected?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Some people are making such thorough preparation for rainy days that they aren't enjoying today's sunshine." - William Feather
-
Yes i want to do this, as this is just a sample app. What kinda keyboard hooks? Any particular function that i can use? Any example code?
HTH KeyBoard Hooks[^] on side note, you are making your system unstable by using hooks. and as inputs from others posters you are changing default functionality of other application.