
Modeless dialog box together with modal dialog box
Quote:
> Is it possible to handle mouse and keyboard events in a modeless
> dialog box whenever a modal dialog box in the same application has
> input focus?
> I have modeless tool window dialog boxes to set simulation states for
> serial port input while developing my application instead of getting
> the input from real devices connected to the serial ports. Sometimes
> my application uses modal dialog boxes to handle testing and
> configuration of the devices connected to the serial port, During the
> time the modal dialog box is active I can (of course) not change any
> setting for the simulated input in my modeless tool window dialog
> boxes. I would like to change this behavior - is it possible to do
> this and still keep the modal dialog box modal?
Yes, you can. When the modal dialog is created, the system automatically
disables
the owner and enables it back after the modal is destroyed. All you have to
do is
call GetOwner()->EnableWindow() in your modal's OnInitDialog.
Or enable whatever window you want. But then your modal dialog won't be so
modal
as it was before :)
Quote:
> If this is not possible, could I make the modal dialog boxes modeless
> and emulate the modal behaviors (disabling mouse and keyboard input)
> for the other visible windows except for the modeless serial input
> simulation dialog boxes?
You can call EnableWindow(FALSE) for all windows except for those you still
want to receive input.
For that, you can send a broadcast message for example, that will reach all
windows except the children.
Or use EnumWindows.
Greets,
Lucian