title: win32 GUI app that writes usage text to stdout when invoked as "app.exe --help"
body: <p>How do I create a windows application that does the following:</p>
  
  <ul>
  <li>it's a regular GUI app when invoked with no command line arguments</li>
  <li>specifying the optional "--help" command line argument causes the app to write usage text to stdout then terminate</li>
  <li>it must be a single executable.  No cheating by making a console app exec a 2nd executable.</li>
  <li>assume the main application code is written in C/C++</li>
  <li>bonus points if no GUI window is created when "--help" is specified.  (i.e., no flicker from a short-lived window)</li>
  </ul>
  
  <p>In my experience the standard visual studio template for console app has no GUI capability, and the normal win32 template does not send its stdout to the parent cmd shell.</p>