modal dialog spawning a modal dialog 
Author Message
 modal dialog spawning a modal dialog



Quote:
>I have a dialog based app, and when the first screen comes up, I want it
>to automatically show another modal dialog box, a setup screen. I can't
>put this in the InitDialog of the first dialog otherwise it doesn't show
>the first dialog before the setup screen.

>Where abouts do I put DoModal for the setup screen, so that the main app
>window comes up, then the setup screen immediately after it?

     It sounds like what you want to do is display the first dialog,
wait a certain amount of time (say, a second) to give the user a chance to
see it, then display the second dialog on top of the first.  Is that
correct?  If so, there are two ways to go about it:
     *In your OnInitDialog for the first dialog, call UpdateWindow() to
make sure that the dialog has been drawn.  Then, call Sleep(1000) to wait for
a second, then go ahead and DoModal() the setup dialog.  This may or may not
work, depending on the specifics of your application.
     *In your OnInitDialog for the first dialog, call SetTimer to set a timer
for 1000 milliseconds later.  Then add an OnTimer handler to your dialog;
that handler should kill the timer, then DoModal() the setup dialog.  This
should always work, at the expense of slightly more complex code.
--
\o\ If you're interested in books and stories with transformation themes, \o\
/o/ please have a look at <URL: http://www.*-*-*.com/ ;. Thanks!  /o/
\o\   FC1.21:FC(W/C)p6arw A- C->++ D>++ H+ M>+ P R T++++ W** Z+ Sm RLCT   \o\
/o/              a cmn++++$ d e++ f+++ h- i++wf p-- sm#                   /o/


Sun, 21 Oct 2001 03:00:00 GMT  
 modal dialog spawning a modal dialog
I have a dialog based app, and when the first screen comes up, I want it
to automatically show another modal dialog box, a setup screen. I can't
put this in the InitDialog of the first dialog otherwise it doesn't show
the first dialog before the setup screen.

Where abouts do I put DoModal for the setup screen, so that the main app
window comes up, then the setup screen immediately after it?

Thanks
--
Chris Cheshire
Software Developer
Northgate Communications Australia
Phone : +61 2 9918 4306
Fax : +61 2 9973 2003

ICQ : 4071141

  "Real programmers don't write specs - users "
  "should consider themselves lucky to get any "
  "programs at all and take what they get."



Mon, 22 Oct 2001 03:00:00 GMT  
 modal dialog spawning a modal dialog

Yeah, not long after I posted this, I realised this. It just seems
rather kludgy thats all....

Quote:
>      It sounds like what you want to do is display the first dialog,
> wait a certain amount of time (say, a second) to give the user a chance to
> see it, then display the second dialog on top of the first.  Is that
> correct?  If so, there are two ways to go about it:
>      *In your OnInitDialog for the first dialog, call UpdateWindow() to
> make sure that the dialog has been drawn.  Then, call Sleep(1000) to wait for
> a second, then go ahead and DoModal() the setup dialog.  This may or may not
> work, depending on the specifics of your application.
>      *In your OnInitDialog for the first dialog, call SetTimer to set a timer
> for 1000 milliseconds later.  Then add an OnTimer handler to your dialog;
> that handler should kill the timer, then DoModal() the setup dialog.  This
> should always work, at the expense of slightly more complex code.
> --
> \o\ If you're interested in books and stories with transformation themes, \o\
> /o/ please have a look at <URL:http://www.halcyon.com/phaedrus>. Thanks!  /o/
> \o\   FC1.21:FC(W/C)p6arw A- C->++ D>++ H+ M>+ P R T++++ W** Z+ Sm RLCT   \o\
> /o/              a cmn++++$ d e++ f+++ h- i++wf p-- sm#                   /o/

--
Chris Cheshire
Software Developer
Northgate Communications Australia
Phone : +61 2 9918 4306
Fax : +61 2 9973 2003

ICQ : 4071141

  "Real programmers don't write specs - users "
  "should consider themselves lucky to get any "
  "programs at all and take what they get."



Mon, 22 Oct 2001 03:00:00 GMT  
 modal dialog spawning a modal dialog

Quote:

>const int WM_SHOW_DIALOG = WM_USER + 1;

Ooops, don't send messages in the WM_USER+ range to dialogs, they
themselves use messages in this range (believe me, I got bit by this
years ago). That's why the new WM_APP identifier was invented.

Personally, I always use registered messages these days.

Bob Moore [MVP]
http://www.mooremvp.freeserve.co.uk
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Due to an unreasonable amount of queries, I no
longer answer unsolicited email questions. Sorry,
no exceptions.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



Mon, 22 Oct 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. modal dialogs on top of modal dialogs...

2. Showing a modal dialog in a modal dialog application

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

4. creating Modal vs. Non-Modal dialogs

5. modal dialog not modal?

6. Modal dialog not acting modal

7. modal dialog to modal less

8. Executing modal tabbed dialog from a dialog-based application

9. Modeless dialog called from Modal dialog woes.

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

11. Modeless dialog box together with modal dialog box

12. Modeless Dialog from Modal Dialog question ?

 

 
Powered by phpBB® Forum Software