Solved

Hiding Main Application Window At Startup

Posted on 1998-12-02
3
354 Views
Last Modified: 2013-11-20
How do I hide the main window at start up? I'm creating an MFC SDI app as a system tray item an would like the program to not show up when it starts. If I use WS_HIDE in the InitInstance() function of the app class the window flashes. I've tried modifing the CREATESTURCT in both OnCreate() and PreCreateWindow() in the MainFrame. For 100 points and what's behind curtain II, what have I missed.?
0
Comment
Question by:hap
  • 2
3 Comments
 

Author Comment

by:hap
ID: 1325692
Edited text of question
0
 
LVL 4

Accepted Solution

by:
pagladasu earned 100 total points
ID: 1325693
The only changes that you have to make are in your InitInstance() member function of your application class:
Here after the line - ParseCommandInfo(cmdInfo); and before the line if (!ProcessShellCommand(cmdInfo) add the following line:
m_nCmdShow=SW_HIDE;
and then change the line with m_pMainWnd->ShowWindow(SW_SHOW) to m_pMainWnd->ShowWindow(m_nCmdShow);
Thanks,
pagladasu
0
 

Author Comment

by:hap
ID: 1325694
Worked perfectly,

Thanks
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Installing Microsoft R server on REDHAT or SUSE Linux 4 152
iSeries FTP Exit Program 8 162
ASCII Non-Printable characters/codes and their HTML equivalents 6 143
has22 challenge 11 106
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question