Is it possible to hide a main window Dialog Box?

Is it possible to hide a main window Dialog Box?

Post by Mark Rent » Sat, 30 Sep 1995 04:00:00



I have an application that has a dialog box as a main window
and I want to hide the window.  Id there any way to do this in
MFC?  It seems that whenever DoModal is called, the
window is shown.  Thanks.

-Mark

 
 
 

Is it possible to hide a main window Dialog Box?

Post by Mark Rent » Sun, 01 Oct 1995 04:00:00


Ive been trying that, but when should I call it?  Do Modal
seems to make the box reappear.  Ive tried even making the
dialog box without the WS_VISIBLE style, but it still shows up?
 Anyone able to do this?  Thanks.

-Mark

 
 
 

Is it possible to hide a main window Dialog Box?

Post by Chris Marriot » Sun, 01 Oct 1995 04:00:00




Quote:>I have an application that has a dialog box as a main window
>and I want to hide the window.  Id there any way to do this in
>MFC?  It seems that whenever DoModal is called, the
>window is shown.  Thanks.

Calling "ShowWindow(SW_HIDE)" should work just fine.

Chris
--
--------------------------------------------------------------------------
 Chris Marriott, Warrington, UK      | Author of SkyMap v2 award-winning

            For full info, see http://www.execpc.com/~skymap  
      Author member of Association of Shareware Professionals (ASP)
--------------------------------------------------------------------------

 
 
 

Is it possible to hide a main window Dialog Box?

Post by Chris Marriot » Mon, 02 Oct 1995 04:00:00




Quote:>Ive been trying that, but when should I call it?  Do Modal
>seems to make the box reappear.  Ive tried even making the
>dialog box without the WS_VISIBLE style, but it still shows up?
> Anyone able to do this?  Thanks.

Forgive me for asking, but WHY do you want an invisible modal dialog?
What's the point of having a dialog at all if it's invisible?

Chris
--
--------------------------------------------------------------------------
 Chris Marriott, Warrington, UK      | Author of SkyMap v2 award-winning

            For full info, see http://www.execpc.com/~skymap  
      Author member of Association of Shareware Professionals (ASP)
--------------------------------------------------------------------------

 
 
 

Is it possible to hide a main window Dialog Box?

Post by Ed Hall » Thu, 05 Oct 1995 04:00:00




: >Ive been trying that, but when should I call it?  Do Modal
: >seems to make the box reappear.  Ive tried even making the
: >dialog box without the WS_VISIBLE style, but it still shows up?
: > Anyone able to do this?  Thanks.
:
: Forgive me for asking, but WHY do you want an invisible modal dialog?
: What's the point of having a dialog at all if it's invisible?

One example is negotiation processing.  In a debug or 'enabled'
environment, it's handy to have a dialog show the negotiation status.  In
a friendly environment, the dialog stays hidden through the process.
By 'negotiation' I mean any linear series of events which happen
(hopefully) behind the scenes, but may be interesting to track visually.

Those Win95 file-copying progress dialogs are such beasts: they are
created when the file-copy starts, but stay invisible until two seconds
have elapsed.  Once the copy takes more than two seconds, they become
visible to show the user how it's going.  If it finishes quickly, the
user never notices that silly paper-flipping animation.

But unfortunately, these are not modal in implementation, even though
they are modal to the user's point of view.  Implement these as modeless
dialogs.  Turn off the WS_VISIBLE in the dialog frame style, don't supply
WS_VISIBLE to the Create() call.  Then use ShowWindow() whenever you like
to show or hide the box, and use EnableWindow() to disable the frame(s) if
it is to act modal.  DoModal() does a lot of arm-twisting and you won't
get what you want.

edh

 
 
 

1. Creating a CList Box from a dialog Resource, using the dialog as the main Window

Thanks for the reply Carl,

I have it sorted out now.

Are there any potential problems in keeping the pointer returned from
the  GetDlgItem() call as a member variable? Because I read in the
help files that the value returned from GetDlgItem can be temporary.

Also I have had a problem with getting the derived CCheckListBox to
work. Are there any tricks or traps to know about when using this
class ? I have been trying to use the method you mentioned in your
previous post to no avail (The Listbox appears with text, but no check
boxes appear)

Thanks
------------------------------------------------
Mark Wickman, Waterstone Leisure (UK)
http://ourworld.compuserve.com/homepages/Waterstone_Leisure_Shareware/

------------------------------------------------
              ** NEW RELEASE **
Download Manager for Win3.x & Win95
- Stores and manages downloaded files with Keywords,Abstract etc.-
ftp.demon.co.uk/pub/ibmpc/win3/apps/download
ftp.demon.co.uk/pub/ibmpc/win95/apps/download
------------------------------------------------

2. CPropertyPages are hogs.

3. Dialog box as main window with menu ?

4. Cannot get email from newly added account

5. Hiding main dialog on startup

6. New images from POV-Ray & Povlab.

7. CPropertySheet as my main dialog -- Possible??

8. INFO: Windows Programmer FAQ: How to get it

9. Resizing List Box along with Main Dialog

10. Resizing dialog Box or Elastic control tool for Dialog Boxes.

11. Killing a modal dialog box from the main frame

12. How do I keep a dialog box from hiding the menu

13. message boxes hide behind dialogs and freeze app