Starting app with hidden window 
Author Message
 Starting app with hidden window

Hi All:

I seem to be unable to start an SDI app with the window hidden.
I can make the window flash briefly and then go away
by using:
CWinApp::InitInstance(...)
{
...
m_pMainWnd->ShowWindow(SW_HIDE);
...

Quote:
}

but I want it not to flash at all.
I have a view derived from CFormView (not CView).

Thanks,  Ido.



Fri, 14 Mar 2003 03:00:00 GMT  
 Starting app with hidden window
Try not to call ShowWindow at all. Maybe it works. I didn't try it.

Dan


Quote:
> Hi All:

> I seem to be unable to start an SDI app with the window hidden.
> I can make the window flash briefly and then go away
> by using:
> CWinApp::InitInstance(...)
> {
> ...
> m_pMainWnd->ShowWindow(SW_HIDE);
> ...
> }

> but I want it not to flash at all.
> I have a view derived from CFormView (not CView).

> Thanks,  Ido.



Fri, 14 Mar 2003 03:00:00 GMT  
 Starting app with hidden window

You must reset the visibility-flag in the window's CREATESTRUCT correctly
BEFORE Create()ing it. You might do it in the PreCreateWindow()-function of
your window-class, which then should contain:

virtual BOOL myWnd::PreCreateWindow(CREATESTRUCT &cs)
{
    if( !CWnd::PreCreateWindow(cs) )    // enter your specific base class
instead of CWnd
        return FALSE;

    cs.style &= ~WS_VISIBLE;        // now the primary state is "hidden"
    return TRUE;

Quote:
}

You might also mask it out when calling the Create()-function by setting its
dwStyle-Parameter as you wish.



Quote:
> Hi All:

> I seem to be unable to start an SDI app with the window hidden.
> I can make the window flash briefly and then go away
> by using:
> CWinApp::InitInstance(...)
> {
> ...
> m_pMainWnd->ShowWindow(SW_HIDE);
> ...
> }

> but I want it not to flash at all.
> I have a view derived from CFormView (not CView).

> Thanks,  Ido.



Fri, 14 Mar 2003 03:00:00 GMT  
 Starting app with hidden window

Ha ha ha. Very funny.



Quote:
> Try not to call ShowWindow at all. Maybe it works. I didn't try it.

> Dan



> > Hi All:

> > I seem to be unable to start an SDI app with the window hidden.
> > I can make the window flash briefly and then go away
> > by using:
> > CWinApp::InitInstance(...)
> > {
> > ...
> > m_pMainWnd->ShowWindow(SW_HIDE);
> > ...
> > }

> > but I want it not to flash at all.
> > I have a view derived from CFormView (not CView).

> > Thanks,  Ido.



Fri, 14 Mar 2003 03:00:00 GMT  
 Starting app with hidden window
Ido,

There is a short article at the url below that discusses how to do what you
want. Look under MFC tips.

Cecil

--
Cecil A. Galbraith
http://www.codesoup.com
Programmers Utilities/Tips


Quote:
> Hi All:

> I seem to be unable to start an SDI app with the window hidden.
> I can make the window flash briefly and then go away
> by using:
> CWinApp::InitInstance(...)
> {
> ...
> m_pMainWnd->ShowWindow(SW_HIDE);
> ...
> }

> but I want it not to flash at all.
> I have a view derived from CFormView (not CView).

> Thanks,  Ido.



Fri, 14 Mar 2003 03:00:00 GMT  
 Starting app with hidden window
It doesn't work for SDI applications

Dan



Sat, 15 Mar 2003 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Starting app with hidden window

2. Help: Starting MFC app with its window hidden

3. Starting Doc/View app with hidden window

4. Start App when Windows starts

5. Can I start my SDI app hidden?

6. How to Start Dialog App Hidden?

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

8. Q: Start App hidden

9. ? Start a Doc/view App as Hidden ?

10. Can I start a dialog app initially hidden?

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

12. Q:How do I start a Dialog App in a HIDE state

 

 
Powered by phpBB® Forum Software