...and the function SetFocus() doesn't work. Do I have to do anything
prior to SetFocus()?
If I try creating the dialog as a normal Modal dialog, the SetFocus
works fine.
The whole point is having the cursor flashing the the CEdit box
without click on it.
Thank you for helping.
Adeluc
DecoTech Design Software Inc.
Internet: http://www.pulsarsoft.com
Michael Gaudette <mgau...@minacom.com> wrote in message
news:374e8f9d....@news.mlink.net...
I just tried using WM_NEXTDLGCTL...with no luck. I believe I have
something to do BEFORE setting the focus (or maybe after...). It
probably has something to do with the method of creation. I am
creating a CMIDChildFrm, then creating the dialog (and setting as
parent to the dialog the CMIDChildFrm created earlier.) Then, in the
OnInitDialog function I am setting to the Edit Box...
Michael Gaudette <mgau...@minacom.com> wrote in message
news:374ed941....@news.mlink.net...
If you use OnInitDialog() to set the focus to a control, then you must return
FALSE from OnInitDialog(). Otherwise Windows will reset the focus to the
first control in the tab order.
HTH,
David Wilkinson
===================
where c_myEditControl is a variable name you add for a control-type
variable in ClassWizard (I use c_ instead of m_ for control variables,
so I don't have to have different names). This will set the focus to
the edit control.
A modal dialog actually does this; when control is created, if you
return TRUE from the OnInitDialog handler, the default is to set the
focus to the first visible, enabled, non-static (user-input-capable)
control. If you switch focus from the app, and switch back, the dialog
manager first saves a reference to the window that had the focus and
upon receiving the focus back, sets the focus to the window that last
had it. But for a modeless dialog, you have to handle this yourself.
joe
Joseph M. Newcomer
newc...@flounder.com
http://www3.pgh.net/~newcomer