(MFC) Q:Modeless Dialog Boxes

(MFC) Q:Modeless Dialog Boxes

Post by Mark T. Wigna » Fri, 01 Jul 1994 01:18:08



Hello any/all!

I'm trying to create a modeless dialog box using MFC and am having some
success, however, it lacks the 'exact' operation I want.

Basically, I've used AppStudio to create the dialog (Pop-up style) and gone
through the steps to make it a modeless dialog.  The problem is that it can be
moved anywhere on the screen ... beyond the confines of the parent FrameWnd.

What I'd like is to have it remain WITHIN the confines of the FrameWnd.  I've
tried the following, and none seem to work:

1.  Changed the style to Child versus Popup.

     Effect:  The Dialog window itself isn't displayed, but as the user tabs
                 between fields(controls) the controls are visible ... where
                 did the dialog itself go?

2.  While overiding the CMyDialog::Create() function, the example I was
     following said to call the base class's Create() function
    CDialog::Create() with the Dialog ID number.  This Create function will
    take two parameters, the second one is a CWnd * that points to the
    window who owns the dialog.  It has a default value of NULL which
    uses the parent frame window.  I tried using a pointer to CMyView as
    the parent, and now the dialog shows, the controls are functioning,
    however, the dialog has no color in the title bar and within the dialog
    frame.

If any of you have had a similar problem, or insight into how one (namely me)
could resolve this, please let me know.

Thanks in advance,
Mark Wignall

 
 
 

(MFC) Q:Modeless Dialog Boxes

Post by Kit Kauffma » Fri, 01 Jul 1994 17:57:12



>Hello any/all!
>I'm trying to create a modeless dialog box using MFC and am having some
>success, however, it lacks the 'exact' operation I want.
>Basically, I've used AppStudio to create the dialog (Pop-up style) and gone
>through the steps to make it a modeless dialog.  The problem is that it can be
>moved anywhere on the screen ... beyond the confines of the parent FrameWnd.
>What I'd like is to have it remain WITHIN the confines of the FrameWnd.  I've
>tried the following, and none seem to work:
>1.  Changed the style to Child versus Popup.
>     Effect:  The Dialog window itself isn't displayed, but as the user tabs
>                 between fields(controls) the controls are visible ... where
>                 did the dialog itself go?
>2.  While overiding the CMyDialog::Create() function, the example I was
>     following said to call the base class's Create() function
>    CDialog::Create() with the Dialog ID number.  This Create function will
>    take two parameters, the second one is a CWnd * that points to the
>    window who owns the dialog.  It has a default value of NULL which
>    uses the parent frame window.  I tried using a pointer to CMyView as
>    the parent, and now the dialog shows, the controls are functioning,
>    however, the dialog has no color in the title bar and within the dialog
>    frame.
>If any of you have had a similar problem, or insight into how one (namely me)
>could resolve this, please let me know.
>Thanks in advance,
>Mark Wignall


The ws_child style is incompatible with dialogs, so that approach is out.

I think you might be able to solve this with WM_GETMINMAXINFO, which allows
you to specify the position and size (obviously you'd make min and max the
same for a dialog).  (Haven't tried it, though).

Later,


                73363,447 (Compu$erve)
                (801) 277-5790

 
 
 

(MFC) Q:Modeless Dialog Boxes

Post by Matt Arno » Sat, 02 Jul 1994 11:05:07



>The ws_child style is incompatible with dialogs, so that approach is out.

No it's not.  Where did you see this documented?  Why does Borland's
Resourcee Workshop let you set the WS_CHILD style for dialog boxes?  How
come the company I work for just shipped a Windows app that I wrote that
has lots of child dialog boxes in it?

It is prefectly fine and desirable to create a dialog box as a child window.
How do you think tollbars and startsubars are done (when they are done with
dialog boxes)?

Matt

 
 
 

(MFC) Q:Modeless Dialog Boxes

Post by Andrew Trevarr » Sun, 03 Jul 1994 02:21:16




>Subject: Re: (MFC) Q:Modeless Dialog Boxes
>Keywords: DIALOG MODELESS MFC
>Date: Fri, 1 Jul 1994 02:05:07 GMT

>>The ws_child style is incompatible with dialogs, so that approach is out.
>No it's not.  Where did you see this documented?  Why does Borland's
>Resourcee Workshop let you set the WS_CHILD style for dialog boxes?  How
>come the company I work for just shipped a Windows app that I wrote that
>has lots of child dialog boxes in it?
>It is prefectly fine and desirable to create a dialog box as a child window.
>How do you think tollbars and startsubars are done (when they are done with
>dialog boxes)?
>Matt

I think that Kit actually meant that the WS_CHILD style is incompatible with
WS_POPUP - but yes, you can have a WS_CHILD, non-WS_POPUP dialog.

Andrew.

---------------------------------------------------------
|                           |                           |

|                           | Software Engineer         |
|                           | JSB Computer Systems Ltd  |
|                           |                           |
---------------------------------------------------------

 
 
 

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

Hi,

Can a modal dialog box be the parent of a modeless dialog box?

I have a dialog box with 7 radio buttons.  Depending on which
button is selected, a different modeless dialog box is displayed.
The user will select a control on the modeless dialog box and then
both the modal and modeless dialog boxes should go away.

I am using VC++ and MFC.

Any help would be appreciated.

Cathy

2. Patch needed for "mode" command.

3. How to create a modeless dialog box under MFC.

4. Announcement: New Pilot

5. How to make a modeless dialog box using MFC?

6. AdSubtract not blocking pop-ups

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

8. Adding a domain to DNS

9. Modeless Dialog in another modeless Dialog

10. Displaying a dialog box in Dialog-based MFC app

11. Modeless Dialog Box and X Button: Access Violation

12. MAPISendMail with modeless dialog box

13. Modeless dialog box