Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Removing the window in MDI app

Removing the window in MDI app

Scheduled Pinned Locked Moved C / C++ / MFC
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    Jake Palmer
    wrote on last edited by
    #1

    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

    T E 2 Replies Last reply
    0
    • J Jake Palmer

      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

      T Offline
      T Offline
      Tomasz Sowinski
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • J Jake Palmer

        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

        E Offline
        E Offline
        EiSl
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups