Can we change the Modal Dialog to Modeless dialog ???

Can we change the Modal Dialog to Modeless dialog ???

Post by Yoges » Wed, 09 Dec 1998 04:00:00



Hello,

I have a problem, I want to change the Modal Dialog box to Modeless
Dialog box, after calling DoModal (of MFC ) or DialogBox (of sdk). If it
can be done then, can you please tell me how to do it,

I will be very thankful to you for this help.

thanks and regards,
yogi.

 
 
 

Can we change the Modal Dialog to Modeless dialog ???

Post by Joku » Wed, 09 Dec 1998 04:00:00


Hello Yogi,

I'm afraid to say that you can't switch to modeless dialog box on your
DoModal() call.  Thats why the function name is DoModal().... it's task is
to show/display your modal dialog box.  But if you want, you can port your
current C????Dlg code from modal to modeless by calling the Create() and
ShowWidnow() function on your constructor and then deleting the instance on
PostNcDestroy() message.  If you need further instructions, just reply back
here.

Hope this helps,
John


Quote:>Hello,

>I have a problem, I want to change the Modal Dialog box to Modeless
>Dialog box, after calling DoModal (of MFC ) or DialogBox (of sdk). If it
>can be done then, can you please tell me how to do it,

>I will be very thankful to you for this help.

>thanks and regards,
>yogi.


 
 
 

Can we change the Modal Dialog to Modeless dialog ???

Post by Howard Rubin - change nospam to n » Thu, 10 Dec 1998 04:00:00



>I have a problem, I want to change the Modal Dialog box to Modeless
>Dialog box, after calling DoModal (of MFC ) or DialogBox (of sdk). If it
>can be done then, can you please tell me how to do it,

You can make a modeless dialog simulate a modal dialog by
disabling its parent with parent->EnableWindow(FALSE)
Then call parent->EnableWindow(TRUE) to get back to modeless.
HTH, Howard Rubin
--
Advertisers using spambots, please don't send to the following addresses:


 
 
 

1. Modal dialog as the parent of a modeless dialog...

Hi,

I'm using a third party activex control in my MDI application. I think
it is written in MFC and of composite type.  It is kind of an editor,
the control has to be created only once and whenever needed it should
be shown
in a modal dialog box.  

Though I'm not very sure, if this is the "correct" implementation, I
did
like this:

The control needs a parent window, so at the application start up,
I create a modeless dialog and creates the control specifying modeless
dialog as its parent and hide the dialog.

While working inside a MDI child window, when the user requests,  a
modal dialog is created (with parent as the CMDIChildWnd) and the
modeless
dialog is made child of of modal dialog & placed inside and shown.
Once the interaction is done, the modeless dialog is hidden.

The hierarchy is like this:
Parent of control is modeless dialog
Parent of modeless dialog is modal dialog
Parent of modal dialog is the CMDIChildWnd.

I'm facing some problems with this implementation, as always, while
handling modal & modeless dialog boxes together.  

1) Though I'm setting the parent of the modeless dialog, its not set.
The GetParent() still returns the mainframe.

2) The keyboard messages are not processed by the control, unless I
return
a FALSE in CMDIChildWnd

3) Keyboard accelerator messages are not received by the modal dialog.
 They
   can be received by the CMDIChildWnd.

I hope my explanation is clear, if not pls let me know.

Any ideas on what's happening?  Also any thoughts on a possible "good
design" would be appreciated.

Thanks in advance for your time.

Regards,
Vith.

2. colormap editor -- very useful

3. Modeless dialog out of a Modal dialog box: possible?

4. Bridgeboard and serial ports

5. Modeless dialog inside modal dialog

6. Slow Printing

7. Modal dialog doesn't disable modeless dialog when running InPlace.

8. Minix 1.5.5 upgrade problems

9. Calling a modeless dialog box from a modal dialog box

10. Showing modeless dialog from modal dialog

11. REPOST: Modal dialog doesn't disable modeless dialog when running

12. Modeless Dialog in another modeless Dialog

13. Help! Modal dialog opening modal dialog = problem