Modeless dialog box together with modal dialog box 
Author Message
 Modeless dialog box together with modal dialog box

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?

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?

Ruben



Mon, 16 Feb 2004 02:31:34 GMT  
 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



Mon, 16 Feb 2004 15:12:34 GMT  
 Modeless dialog box together with modal dialog box
Thanks for Your valued help.

I was thinking about something like this but I wasn't sure how this
would work with a Modal dialog box. I will try this at once.

Ruben



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 :)

>> 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



Mon, 16 Feb 2004 17:50:50 GMT  
 Modeless dialog box together with modal dialog box
Works Great. Now I have semi modal dialog boxes :-)

Ruben



Quote:
>Thanks for Your valued help.

>I was thinking about something like this but I wasn't sure how this
>would work with a Modal dialog box. I will try this at once.

>Ruben





>>> 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 :)

>>> 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



Mon, 16 Feb 2004 18:27:02 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Modeless Dialog box in a Modal Dialog Application...

2. Post message from modal dialog to modeless dialog box....urgent!!!!!!!!!!!!!!1

3. MAPI Modal Dialog Box instead of Modeless

4. Modal to Modeless dialog box

5. List boxes in Modal Dialog Box

6. Dialog containing a CTabCtrl containing a modeless dialog box, shortcuts don't work

7. Modeless property sheet in a modeless dialog box

8. activating a button on a dialog box from a dialog box

9. Dialog box in a dialog box

10. transfer data from one dialog box to another dialog box

11. PBM: Message box not displayed after main dialog box is closed in MFC dialog-based app

12. set an arbitrary printer driver in print dialog box without showing the print dialog box

 

 
Powered by phpBB® Forum Software