[comp.windows.ms.programmer] Focus in Dialog Box?

ghenniga@hertz.ee (Gary Hennigan) (05/18/91)

I'm having a little problem with a Dialog box I hope someone can help with.
I've set up the dialog box with IDOK and IDCANCEL but there are certain
child controls that, when the user is in them, I don't wish to process the
IDOK message when the RET key is pressed. Is there any way to determine
which child control within the dialog box has the input focus based on the
Dialog ID of the child control? In particular I don't wish the RET key to
generate an IDOK if the user is in the "Filter" Edit control in an Open file
dialog box, in other child controls, however, I would still like the RET key
to generate the IDOK message in wParam. Any ideas? Unfortunately I haven't
purchased any of the SDK documentation yet so I'm stuck with Petzhold's book
and the online SDK in BC++. You definately need some of the SDK material!

Thanks,

ebergman@isis.cs.du.edu (Eric Bergman-Terrell) (05/19/91)

Sounds like GetFocus(), which returns the handle of the active window,
is what you want.  Consider getting the Windows Guide to Programming and the
Windows Prog. Ref.  Both are definitely worth the money (like you I started
out with just Petzold's book).

Terrell