|
-
February 18th, 2009, 11:48 PM
#6
Re: Focus Problem in MFC Dialog Project
 Originally Posted by Ido_I
I've enabled the ON_WM_SETFOCUS() and ON_WM_KILLFOCUS() options so
Correction: you did not enable anything. You have inserted WM_SETFOCUS and WM_KILLFOCUS handlers.
[QUOTE= I'm trying to set the focus to be on my dialog so I will be able to use the WM_KEYDOWN to capture keyboard input. . .
What am I doing wrong?
BTW: I'm using visual studio 2005 with an MFC project.[/QUOTE]
 Originally Posted by Ido_I
I would like the dialog box to control the keyboard input from one main place. The way I understand it, if I use OnKeyDown in the main dialog file (XXDlg.cpp), then every input of the keyboard should direct me to the OnKeyDown routine,
 Originally Posted by Ido_I
I know I'm doing something wrong, as my knowledge of the MFC is very poor,
It does not matter what version of VS you are using. Also, this is not MFC. It is a dialog default behavior that you are struggling against. By design, dialog that has at least one control, never has a keyboard focus.
 Originally Posted by Ido_I
I know I'm doing something wrong, as my knowledge of the MFC is very poor,
Proper way is to insert handlers for each control. Alternatively, you can use OnNotify or OnCommand if controls generate command or notification messages.
There are only 10 types of people in the world:
Those who understand binary and those who do not.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|