Hiding a dialog-based app 
Author Message
 Hiding a dialog-based app

I have an dialog-based application that, among other things, places an icon
in the system drawer. I wolud like to hide everything except form the icon
in the system drawer.
I tried overriding ShowWindow(), PreCreateWindow(), changing styles, etc.
with no results. The dialog window keeps on showing even if, after that, I
do succeed in e.g. minimizing it, etc.

Any help?

Thanks.

Enrico



Wed, 15 Nov 2000 03:00:00 GMT  
 Hiding a dialog-based app

Unfortunately this does not seem to be the case (if I do not get wrong on
something else..). If you put it in CYourDlg::InitDialog() this does not
prevent the dialog to show (remember it is a dialog-based app).
This is just the problem I have.

Thanks


Quote:

>> I have an dialog-based application that, among other things, places an
icon
>> in the system drawer. I wolud like to hide everything except form the
icon
>> in the system drawer.
>> I tried overriding ShowWindow(), PreCreateWindow(), changing styles, etc.
>> with no results. The dialog window keeps on showing even if, after that,
I
>> do succeed in e.g. minimizing it, etc.

>> Any help?

>> Thanks.

>> Enrico

>No problem

>CYourDlg::ShowWindow(SW_HIDE);

>Does what you want.

>Tim



Thu, 16 Nov 2000 03:00:00 GMT  
 Hiding a dialog-based app

Quote:

> I have an dialog-based application that, among other things, places an icon
> in the system drawer. I wolud like to hide everything except form the icon
> in the system drawer.
> I tried overriding ShowWindow(), PreCreateWindow(), changing styles, etc.
> with no results. The dialog window keeps on showing even if, after that, I
> do succeed in e.g. minimizing it, etc.

> Any help?

> Thanks.

> Enrico

No problem

CYourDlg::ShowWindow(SW_HIDE);

Does what you want.

Tim



Fri, 17 Nov 2000 03:00:00 GMT  
 Hiding a dialog-based app

Quote:

> Unfortunately this does not seem to be the case (if I do not get wrong on
> something else..). If you put it in CYourDlg::InitDialog() this does not
> prevent the dialog to show (remember it is a dialog-based app).
> This is just the problem I have.

> Thanks



> >> I have an dialog-based application that, among other things, places an
> icon
> >> in the system drawer. I wolud like to hide everything except form the
> icon
> >> in the system drawer.
> >> I tried overriding ShowWindow(), PreCreateWindow(), changing styles, etc.
> >> with no results. The dialog window keeps on showing even if, after that,
> I
> >> do succeed in e.g. minimizing it, etc.

> >> Any help?

> >> Thanks.

> >> Enrico

> >No problem

> >CYourDlg::ShowWindow(SW_HIDE);

> >Does what you want.

> >Tim

The CYourDlg::ShowWindow(SW_HIDE); call must be made after the window
is already visable - I am also tring to start my dlg based app without
it being shown at all till I tell it to.

Tim



Fri, 17 Nov 2000 03:00:00 GMT  
 Hiding a dialog-based app

Quote:
>Unfortunately this does not seem to be the case (if I do not get wrong on
>something else..). If you put it in CYourDlg::InitDialog() this does not
>prevent the dialog to show (remember it is a dialog-based app).

I've not come across a really elegant way of doing this. The best I've
got is to post a user defined message in OnInitDialog, and position
the dialog off-screen. In the processing of the user defined message
hide the window, and when you want to display it you can reposition
it. Here's the general idea:

BEGIN_MESSAGE_MAP(CMindlgDlg, CDialog)
        //{{AFX_MSG_MAP(CMindlgDlg)
        ...
        //}}AFX_MSG_MAP
        ON_MESSAGE( WM_APP+1, OnAppMsg )
END_MESSAGE_MAP()

BOOL CMindlgDlg::OnInitDialog()
{
        ...

        // TODO: Add extra initialization here
        SetWindowPos( NULL, -1000, -1000, 0, 0,
                        SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE );

        PostMessage( WM_APP+1 );

        return TRUE;

Quote:
}

LRESULT CMindlgDlg::OnAppMsg(WPARAM, LPARAM)
{
        ShowWindow( SW_HIDE );
        return 0;

Quote:
}

Dave
----
Address is altered to discourage junk mail.
Please post responses to the newsgroup thread,
there's no need for follow up email copies.


Sat, 18 Nov 2000 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. HOWTO: hide dialog when a dialog-based app starts

2. hiding an mfc dialog based app

3. How to hide a messagebox before it pops up, in a dialog based app

4. Hide dialog based app on startup

5. How can I tell when a dialog based app gets hidden or exposed

6. Hide dialog based apps

7. A: How to start dialog-based app hidden

8. Hiding a dialog based app on startup

9. Resizing a dialog based app based on its view's size

10. Main dialog initially hidden, how? (mfc dialog app)

11. Modeless dialog in a dialog-based app

12. dialog within dialog based apps

 

 
Powered by phpBB® Forum Software