Click here to Skip to main content
15,921,941 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Hide console window of Win32 console application Pin
Jonathan [Darka]18-Dec-03 22:35
professionalJonathan [Darka]18-Dec-03 22:35 
Generalmsflxgrd.ocx Pin
avelasco17-Dec-03 23:05
sussavelasco17-Dec-03 23:05 
GeneralI need to load a driver Pin
abhiram17-Dec-03 22:17
abhiram17-Dec-03 22:17 
Generali need the gurushelp-image processing Pin
satadru17-Dec-03 21:32
satadru17-Dec-03 21:32 
GeneralRe: i need the gurushelp-image processing Pin
Monty217-Dec-03 21:39
Monty217-Dec-03 21:39 
GeneralRe: i need the gurushelp-image processing Pin
satadru17-Dec-03 23:37
satadru17-Dec-03 23:37 
GeneralRe: i need the gurushelp-image processing Pin
Monty218-Dec-03 0:25
Monty218-Dec-03 0:25 
GeneralSetFocus, "Enter" key and child dialogs Pin
J.B.17-Dec-03 21:18
J.B.17-Dec-03 21:18 
Hello guys,
I am still having trouble to catch "Enter" (Return) key press from a PC keyobard in my app. I think the problem mainly comes from the fact that the app has a parent dialog with serveral embedded child dialogs (only one child dialog is shown at a time on the app window, different child dialog is shown using ShowWindow(SW_SHOW), ShowWindow(SW_HIDE).

Preferrably, I want the child dialogs to catch the "Enter" key press. So what I did, was first, "return 0" in the parent class' OnInitDialog() and set the focus to the appearing child's DDX control, say a CButton, in the child class' OnShowWindow().

With the above method, I can get the focus set (using SetFocus()) to each desired CButton in the child dialogs and I can cycle through the buttons (if there are multiple) in each shown child dialog using arrow keys. However, none of the buttons will not respond to "Enter" key, but only "Spacebar" key to perform OnBnClicked() function. If I "tab" to the button that belong to the parent dialog, pressing the "Enter" key will call the OnBnCliked(). Can anyone explain why?

Also, I tried to see if the Enter key is caught in the child class by overriding its OnOk() or OnKeyDown() but the key pressed doesn't seem to go through them either.
GeneralRe: SetFocus, "Enter" key and child dialogs Pin
tiaozi18-Dec-03 2:27
tiaozi18-Dec-03 2:27 
GeneralRe: SetFocus, "Enter" key and child dialogs Pin
J.B.18-Dec-03 5:20
J.B.18-Dec-03 5:20 
GeneralRe: SetFocus, "Enter" key and child dialogs Pin
J.B.18-Dec-03 6:02
J.B.18-Dec-03 6:02 
GeneralRe: SetFocus, "Enter" key and child dialogs Pin
J.B.18-Dec-03 6:25
J.B.18-Dec-03 6:25 
GeneralVC++ Method Pin
Ming Yan17-Dec-03 21:04
Ming Yan17-Dec-03 21:04 
GeneralRe: VC++ Method Pin
Abebe17-Dec-03 21:37
Abebe17-Dec-03 21:37 
GeneralRe: VC++ Method Pin
Ming Yan17-Dec-03 21:40
Ming Yan17-Dec-03 21:40 
GeneralRe: VC++ Method Pin
Balkrishna Talele18-Dec-03 0:03
Balkrishna Talele18-Dec-03 0:03 
GeneralRe: VC++ Method Pin
Rowan Seymour18-Dec-03 0:04
Rowan Seymour18-Dec-03 0:04 
GeneralRe: VC++ Method Pin
Vikash Dubey18-Dec-03 0:06
Vikash Dubey18-Dec-03 0:06 
GeneralProblem With LibTiff Pin
Sumit Kapoor17-Dec-03 20:59
Sumit Kapoor17-Dec-03 20:59 
GeneralBeginner question... Pin
Lord Tor17-Dec-03 17:40
Lord Tor17-Dec-03 17:40 
GeneralRe: Beginner question... Pin
Prakash Nadar17-Dec-03 19:25
Prakash Nadar17-Dec-03 19:25 
GeneralRe: Beginner question... Pin
Joe Woodbury18-Dec-03 5:28
professionalJoe Woodbury18-Dec-03 5:28 
Generaldesigning pci driver using C++ Pin
nmelah17-Dec-03 16:55
nmelah17-Dec-03 16:55 
GeneralRe: designing pci driver using C++ Pin
John M. Drescher17-Dec-03 17:07
John M. Drescher17-Dec-03 17:07 
GeneralRe: designing pci driver using C++ Pin
Kannan Ramanathan17-Dec-03 17:15
Kannan Ramanathan17-Dec-03 17:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.