Modeless Dialog from Modal Dialog question ? 
Author Message
 Modeless Dialog from Modal Dialog question ?

Hi,
The Modeless Dialog is created when a button in the Modal Dialog is pressed
and I use it to display various events that occur. I want the Modal Dialog
to be in front however, and cannot seem to achieve it.
In the function that creates the Modeless Dialog, I've tried various ways
like this->BringWindowToTop, but to no avail. I keep having to drag the
Modeless Dialog out of the way.

Any assistance appreciated

thanks,
Duncan



Wed, 15 Dec 2004 09:43:47 GMT  
 Modeless Dialog from Modal Dialog question ?
Did you make the modal dialog the parent of the modeless one?  If so,
that's why it always stays in front.  Try setting the parent to be the
parent of the modal dialog instead.


Wed, 15 Dec 2004 11:52:33 GMT  
 Modeless Dialog from Modal Dialog question ?
Scott,

I've tried a couple of things, all variations on the following ...

void TestDlg::OnLog()
{
...
 m_pLogDialog = new CLOGDialog(NULL);
 m_pLogDialog->Create();
this->BringWindowToTop();
...

Quote:
}

... where TestDlg is the Modal Dialog box that represents the main
application and CLOGDialog is a Modeless dialog box that contains a listbox,
a Clear button and an Exit button.

I'm wondering if I've missed a style setting or something that overrides
things.

thanks,
Duncan



Quote:
> Did you make the modal dialog the parent of the modeless one?  If so,
> that's why it always stays in front.  Try setting the parent to be the
> parent of the modal dialog instead.



Wed, 15 Dec 2004 13:13:36 GMT  
 Modeless Dialog from Modal Dialog question ?
Scott,
Also, I forgot to say that the code segment below does make the Modal Dialog
the active window, but the Modeless one is still physically in front of it.

Duncan


Quote:
> Scott,

> I've tried a couple of things, all variations on the following ...

> void TestDlg::OnLog()
> {
> ...
>  m_pLogDialog = new CLOGDialog(NULL);
>  m_pLogDialog->Create();
> this->BringWindowToTop();
> ...
> }

> ... where TestDlg is the Modal Dialog box that represents the main
> application and CLOGDialog is a Modeless dialog box that contains a
listbox,
> a Clear button and an Exit button.

> I'm wondering if I've missed a style setting or something that overrides
> things.

> thanks,
> Duncan



> > Did you make the modal dialog the parent of the modeless one?  If so,
> > that's why it always stays in front.  Try setting the parent to be the
> > parent of the modal dialog instead.



Wed, 15 Dec 2004 13:18:21 GMT  
 Modeless Dialog from Modal Dialog question ?
If the modal dialog is the main window of your app, then setting the
parent parameter to NULL results in the main window being used.  So, the
modal dialog ends up being the parent again.
Try using GetDesktopWindow() as the parent.


Wed, 15 Dec 2004 22:51:35 GMT  
 Modeless Dialog from Modal Dialog question ?
Scott,
Looks like that did the trick  ... I had misunderstood the use of NULL, and
took NULL to mean the desktop. All seems OK now ...

thanks,
Duncan



Quote:
> If the modal dialog is the main window of your app, then setting the
> parent parameter to NULL results in the main window being used.  So, the
> modal dialog ends up being the parent again.
> Try using GetDesktopWindow() as the parent.



Thu, 16 Dec 2004 03:46:50 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Modeless dialog called from Modal dialog woes.

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

3. Modeless dialog box together with modal dialog box

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

5. Modeless dialog on top of Modal dialog

6. Modeless Child Dialog of Modal Dialog

7. modal dialogs on top of modal dialogs...

8. Showing a modal dialog in a modal dialog application

9. modal dialog spawning a modal dialog

10. Modal dialog over a modal dialog ( How to...?)

11. ATL Dialog Template - Modal/Modeless Tab Stop Behaviour

12. MAPI Modal Dialog Box instead of Modeless

 

 
Powered by phpBB® Forum Software