I'm creating a dialogbox with a picture control and whenever I initialize the dialog it sets the focus to that picture control, is there any way to give dialog the default without resetting the focus from picture control?
+1
A:
When you get the WM_INITIDIALOG
message in your dialog procecure, if you return FALSE then it will not set the focus to one of the controls in the dialog.
from http://msdn.microsoft.com/en-us/library/ms645428(VS.85).aspx
The dialog box procedure should return TRUE to direct the system to set the keyboard focus to the control specified by wParam. Otherwise, it should return FALSE to prevent the system from setting the default keyboard focus.
Normally, what you would do is set the focus to whichever control you choose in WM_INITDIALOG
and then return FALSE to prevent windows from changing the focus.
John Knoeller
2010-03-14 02:02:49