Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Hiding Main Application Window At Startup

Posted on 1998-12-02
3
353 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
xyBalance chalenge 58 96
Perl Awk Need Help 3 128
dog bark java program 15 109
zeroMAx challenge 20 111
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

856 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