title: What is the purpose of hPrevInstance in WinMain
body: <p>The <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms633559(v=vs.85).aspx" rel="noreferrer">definition of <code>WinMain</code></a> is:</p>
  
  <pre><code>int CALLBACK WinMain(
      _In_ HINSTANCE hInstance,
      _In_ HINSTANCE hPrevInstance,
      _In_ LPSTR     lpCmdLine,
      _In_ int       nCmdShow
  );
  </code></pre>
  
  <p>What I understand is:</p>
  
  <ul>
  <li><code>hInstance</code> is a handle to the application's instance and can, <a href="https://stackoverflow.com/questions/21718027/getmodulehandlenull-vs-hinstance">when not a DLL, be retrieved with <code>GetModuleHandle(NULL)</code></a></li>
  <li><code>szCmdLine</code> is the command line arguments and can be retried with <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms683156(v=vs.85).aspx" rel="noreferrer"><code>GetCommandLine()</code></a></li>
  <li><code>nCmdShow</code> is usually <code>SW_SHOW</code></li>
  </ul>
  
  <p>However, <em>never</em> have I come across <em>any</em> usage of <code>hPrevInstance</code>, even in books from the late <em>1990s</em>. So, what, if any, is the use of <code>hPrevInstance</code>, and what exactly <em>is</em> it?</p>