Removing the window in MDI app
-
MDI applications begin with a blank window by default. What code creates this, and how can I prevent it from opening immediately? There are certainly programs that open up without a blank window, such as Photoshop. thanks- Jake
-
MDI applications begin with a blank window by default. What code creates this, and how can I prevent it from opening immediately? There are certainly programs that open up without a blank window, such as Photoshop. thanks- Jake
Change your application's InitInstance:
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
if (CCommandLineInfo::FileNew == cmdInfo.m_nShellCommand)
{
cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing;
}Tomasz Sowinski -- http://www.shooltz.com.pl
-
MDI applications begin with a blank window by default. What code creates this, and how can I prevent it from opening immediately? There are certainly programs that open up without a blank window, such as Photoshop. thanks- Jake
Hello Jake, I suppose you've created a MDI application using the VC++ Wizard. In this case, the creation of the first initial document is performed by ProcessShellCommand(cmdInfo) in the main of your program. If you check the docs, you will find that next code: ---- // Parse command line for standard shell commands, DDE, file open CCommandLineInfo cmdInfo; ParseCommandLine(cmdInfo); // Dispatch commands specified on the command line if (!ProcessShellCommand(cmdInfo)) return FALSE; --- will handle the passed arguments when you execute the application. You can override these by writing your own command-line parsing stuff. The default behaviour of ProcessShellCommand is when not passing parameters with your application: "Start appl. and open new document". Hopes this helps, EiSl