Thank you. That was one of the best responses I have ever received from a
question. I really appreciate the effort. I was able to fix the problem.
Basically, the tab control was the parent for the child dialog boxes. I just
changed the parent to be the parent dialog box that contains the tab control.
By the way, I did have the IsDialogMessage call in my message loop already. I
am using a modeless dialog box inside my main app window.
> > Hello,
> > I have been having problems getting the TAB key to work correctly with
> > my dialog box. The dialog box contains a tab control. The tab control
> > creates a child dialog box for each tab. The tab key works correctly
> > for the main dialog box controls. And if I click on a control on one of
> > the child dialog boxes, that works correctly. However, I can't use the
> > TAB key to move between the two dialog boxes. I'm not using MFC so
> > please don't provide any answers involving that. It will just confuse
> > me more.
> > By the way, I have the DS_CONTROL and WS_CHILD styles set for the child
> > dialog boxes.
> The processing the tab keys is done via the IsDialogMessage filter proc in
> the dialogs message loop. If the dialog is modeless you must call it
> yourself, if modal, its done for you.
> Note that IsDialogMessage takes a handle to the dialog to process the
> message for.
> Now, IsDialogMessage will only handle a TAB keystroke is one of the controls
> on a dialog currently has focus.
> So, IsDialogMessage() takes the passed in hwnd, and calls GetWindow() in a
> loop first with GW_CHILE and then GW_NEXT to enumerate each child window. If
> it hits any child window with the DS_CONTROL style, it will recurse, and
> chack all the child controls on that window.
> So, some questions:
> 1. Is the dialog box modeless? If so, are you calling IsDialogMessage() in
> your message loop, passing the handle of the dialog box?
> 2. What are you using as the parent of the dialog page - the TAB control, or
> the dialog itself? If you are using the TAB control be aware that there is
> now a seperation between the main dialog and your page - the tab control
> will have to have DS_CONTROL set so that IsDialogMessage can recurse through
> the control to find your dialog page. Better is to simply use the main
> dialog as your pages parent.
> Chris [MVP]
> VisualC++ & Win32 FAQ: http://www.mvps.org/vcfaq
> My Win32 Page: http://users.lia.net/chris/win32
> > Thanks in advance.
> > --
> > __________________________________________________
> > Christopher Smith (Direct) (408) 737-6160
> > Technical Staff (Main) (408) 738-5390
> > EOO, Inc. (Fax) (408) 738-5399
Christopher Smith (Direct) (408) 737-6160
Technical Staff (Main) (408) 738-5390
EOO, Inc. (Fax) (408) 738-5399