title: What is nCmdShow?
body: <p>I've always been curious on what nCmdShow means in WinMain of a C program using Windows API.</p>
  
  <p>I looked up the formal explanation: "Controls how the window is to be shown. This parameter can be one of the following values.".</p>
  
  <p>I do not understand what that means, as a Windows program can contain more than one window, or no windows at all. In addition, as program begins, there is no window to be shown to begin with, which makes me question this argument even more.</p>
  
  <p>Also from what I read, it always stays 10, which isn't even on the list of options in "<a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms633559%28v=vs.85%29.aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/windows/desktop/ms633559%28v=vs.85%29.aspx</a>"...</p>
  
  <p>Is it obsolete? Can somebody explain its purpose, or provide any references explaining its use? I tried googling but saw nothing.</p>
  
  <p>Thanks!</p>
  
  <p><b>REVISITED</b>: <br /></p>
  
  <p>When you right click a shortcut and go to properties, there is an option to start the window Minimized, Maximized, or Normal(ly).</p>
  
  <p>Windows provides an nCmdShow to your program in case it wants to act in a special way if it was launched in any of these three ways. For example, it may hide itself inside notification bar if it was requested to be started minimized.</p>
  
  <hr>
  
  <p>For exhaustiveness:</p>
  
  <p><a href="https://i.stack.imgur.com/KHnO6.png" rel="noreferrer"><img src="https://i.stack.imgur.com/KHnO6.png" alt="enter image description here"></a></p>
  
  <p><a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms633548(v=vs.85).aspx" rel="noreferrer">https://msdn.microsoft.com/en-us/library/windows/desktop/ms633548(v=vs.85).aspx</a> describes all the different ways that may be passed.</p>