? Start a Doc/view App as Hidden ? 
Author Message
 ? Start a Doc/view App as Hidden ?

I am writing an app that utilises MFC Doc/View. However, the default start
up mode for the app is as a icon in the sys tray. Therefor the application
should start as hidden.

How can I initialise the doc/view without creating a visible window?

The obvious method :

m_pMainWnd->ShowWindow(SW_HIDE);

called during CMyApp::InitInstance()

causes the window to flash on then off as the window has already been shown
by the call to

ProcessShellCommand(cmdInfo);



Sat, 23 Nov 2002 03:00:00 GMT  
 ? Start a Doc/view App as Hidden ?
I believe that I've read (more than once) on this group that if you set
CWinApp::m_nCmdShow to SW_HIDE before your ProcessShellCommand call that you
will achieve the results you desire.

TFM3

Note: Spam-resistant e-mail address


Quote:
> I am writing an app that utilises MFC Doc/View. However, the default start
> up mode for the app is as a icon in the sys tray. Therefor the application
> should start as hidden.

> How can I initialise the doc/view without creating a visible window?

> The obvious method :

> m_pMainWnd->ShowWindow(SW_HIDE);

> called during CMyApp::InitInstance()

> causes the window to flash on then off as the window has already been
shown
> by the call to

> ProcessShellCommand(cmdInfo);



Sat, 23 Nov 2002 03:00:00 GMT  
 ? Start a Doc/view App as Hidden ?

Quote:
>I am writing an app that utilises MFC Doc/View. However, the default start
>up mode for the app is as a icon in the sys tray. Therefor the application
>should start as hidden.

>How can I initialise the doc/view without creating a visible window?

>The obvious method :

>m_pMainWnd->ShowWindow(SW_HIDE);

>called during CMyApp::InitInstance()

>causes the window to flash on then off as the window has already been shown
>by the call to

>ProcessShellCommand(cmdInfo);

Jeroen,

I think this will prevent the flash:

        // Dispatch commands specified on the command line
        m_nCmdShow = SW_HIDE;

        if (!ProcessShellCommand(cmdInfo))
                return FALSE;

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
My address is altered to discourage junk mail.
Please post responses to the newsgroup thread,
there's no need for follow-up email copies.



Sat, 23 Nov 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Starting Doc/View app with hidden window

2. ? Start a Doc/View App as Hidden?

3. MFC doc-view architecture with hidden view

4. Getting 2nd Doc/View data from 1st Doc/View

5. Can I start my SDI app hidden?

6. How to Start Dialog App Hidden?

7. Help: Starting MFC app with its window hidden

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

9. Starting app with hidden window

10. Q: Start App hidden

11. Can I start a dialog app initially hidden?

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

 

 
Powered by phpBB® Forum Software