i open a dialogbox that contains two edit controls, and two buttons. One button has BS_DEFPUSHBUTTON style ... so it get focus ... but i want the first edit control to get the focus and then the user push the default button and continue ... ideas?
Posted on 2001-07-05 06:09:00 by unknow
in your wm_create use the following api to set focus to your editbox when your program loads. invoke SetFocus,hEditHandle smurf
Posted on 2001-07-05 06:31:00 by smurf
Or (if its defined in a .res file):

invoke SendDlgItemMessage, hDlg, EDIT1, WM_SETFOCUS, NULL, NULL
Posted on 2001-07-05 06:44:00 by Mirno
According to standard windows doc the application gets handle (in wParam) of control to receive focus in WM_INITDIALOG and should return FALSE if it wants another control to receive focus (in which case the application should have called SetFocus() before returning from WM_INITDIALOG). There is also a misunderstanding of flag BS_DEFPUSHBUTTON. A button defined with this flag will not automatically receive the focus on start of a dialog. Instead it will receive a WM_COMMAND/BN_CLICKED message if the user presses . japheth This message was edited by japheth, on 7/5/2001 6:56:01 AM
Posted on 2001-07-05 06:50:00 by japheth
I try: call GetDlgItem, EDIT1 call SetFocus,EAX didnt work ... then try: call SendDlgItemMessage, hDlg, EDIT1, WM_SETFOCUS, NULL, NULL well, the cursor appears in the editbox but i cant write anything into it ... until i push oen time the shift key. :?
Posted on 2001-07-05 07:04:00 by unknow
unknow, Two things, change the order of the controls in the RC file so that the edit control you want to have focus is first, then change the style of the button to a normal one. Should do the job for you OK. Regards, hutch@pbq.com.au
Posted on 2001-07-05 08:03:00 by hutch--
i tried ... but fails :( ...
Posted on 2001-07-05 09:26:00 by unknow
post the source code of the dialog box proc.
Posted on 2001-07-05 09:43:00 by japheth