Solved

Hiding Main Application Window At Startup

Posted on 1998-12-02
3
349 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
Comment Utility
Edited text of question
0
 
LVL 4

Accepted Solution

by:
pagladasu earned 100 total points
Comment Utility
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
Comment Utility
Worked perfectly,

Thanks
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
This video discusses moving either the default database or any database to a new volume.

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now