title: Is it OK to hide Delphi's "Application" Window?
body: <p>We just moved our application from a MDI container to a single document interface.  Our users are used to using a "Windows" menu in the MDI parent to show windows side by side.  We want to train them to right click on the Windows taskbar and use the window management functions there.</p>
  
  <p>With Delphi applications we noticed that the windows shell leaves room for the hidden "Application" window.  So if I only have two windows open it will arrange room for three.  The Application window is not really shown but there is space left for it.  </p>
  
  <p>This is made worse by the fact that we have two different applications.  If they only have one window open in each application and want to show them side by side windows will actually try to account for 4 windows.</p>
  
  <p>So instead of seeing two windows each taking 1/2 of the screen I see two windows that take up 1/4 of the desktop and the rest of the screen is open.</p>
  
  <p>I found that adding a line to hide the application window as my application starts up will fix this problem.  </p>
  
  <p><del>    ShowWindow(Application.Handle, SW_HIDE);  </del>  </p>
  
  <blockquote>
    <p>Edit in case someone does not read
    down to the answer.  Based on Craig's
    answer below I am setting the windows
    style to WS_EX_TOOLWINDOW instead of
    hiding the window.
          <strong>SetWindowLong(Application.Handle, GWL_EXSTYLE,
            GetWindowLong(Application.Handle, GWL_EXSTYLE) or WS_EX_TOOLWINDOW);</strong></p>
  </blockquote>
  
  <p>My (original) questions is: Is this safe (hiding the application window)?  I'm wondering if I may be breaking something else by hiding the Application window.  Are there any side effect I need to be aware of?  Is there a better way to solve this issue?</p>
  
  <p>I'm using Delphi 2007.  The issues seem to be consistent across Windows XP, Vista, and 7.</p>
  
  <p><strong>Update:</strong> Some of the answers seem to think the problem is with the Application forms icon being visible.  That is not the case.  I already have MainFormOnTaskbar set to true.</p>
  
  <p>Also if you are testing this be aware that the Delphi IDE (only tested with 2007) makes things worse.  Try this.  Open the Delphi IDE and two instances of notepad.  Minimize the IDE but have both notepads un-minimized.  Right click on choose Show Windows Side by Side.  You will see each notepad take up 1/3 of the screen.  Close the IDE and choose Show Windows Side by Side again and each will take up 1/2 half of the screen.  </p>