title: How to stop Explorer starting my application maximized?
body: <p>Explorer seems to always start my application with <code>SW_MAXIMIZE</code> (<code>STARTF_USESHOWWINDOW</code> is set in <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms686331(v=vs.85).aspx" rel="nofollow noreferrer"><code>STARTUPINFO.dwFlags</code></a>). I know that <code>ShowWindow</code> will use this value <a href="http://blogs.msdn.com/b/oldnewthing/archive/2010/03/01/9970655.aspx" rel="nofollow noreferrer">the first time</a> you/Windows needs to display a window but it has the unfortunate consequence of maximizing a window that should never be maximized. </p>
  
  <p>My window is created with <code>CreateDialogIndirectParam</code> and has the following styles: <code>WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX|WS_CLIPCHILDREN|DS_MODALFRAME|DS_CENTER|WS_VISIBLE</code>. Why does <code>ShowWindow</code> not check if <code>WS_MAXIMIZEBOX</code> is set before allowing <code>STARTF_USESHOWWINDOW</code> to force <code>SW_MAXIMIZE</code>? Is this a bug in Windows?</p>
  
  <p>This happens on a HP Stream 7 with Windows 8.1. I'm not sure if Explorer does this because it is touch enabled or because of the small screen.</p>
  
  <p>Is this Explorer behavior documented anywhere and is there a way to turn it off? What is the best way to stop Explorer (or any other parent process) from affecting my initial window mode? (I don't want to block people starting me with <code>SW_*MINIMIZE*</code>)</p>
  
  <p>WinVer.exe in system32 has the same problem:
  <img src="https://i.stack.imgur.com/O51Qz.png" alt="enter image description here"></p>