Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Hiding Main Application Window At Startup

Posted on 1998-12-02
3
Medium Priority
?
360 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
[X]
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
  • 2
3 Comments
 

Author Comment

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

Accepted Solution

by:
pagladasu earned 400 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
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.
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

604 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