title: WPF Application with GUI and Console modes
body: <p>I understand that there are problems regarding running a WPF application from a console window and outputting to the console rather than showing a gui (aka <a href="https://stackoverflow.com/questions/510805/can-a-win32-console-application-detect-if-it-has-been-run-from-the-explorer-or-no">This Question</a>).</p>
  
  <p>The 'conclusion' of that question (which appears to be well researched and asked) is that it is possible to output from the application to the console, but it returns immediately - rather than blocking like a console application would.</p>
  
  <p>However, looking at Visual Studio particularly the 'devenv.exe' process, this is exactly what it does manage to do:</p>
  
  <ul>
  <li>Double clicking on devenv.exe from within explorer runs the application gui only.</li>
  <li>From within a console (cmd.exe) window
  
  <ul>
  <li><code>devenv.exe&lt;enter&gt;</code> runs the Gui returning to the console immediately   </li>
  <li><code>devenv.exe /?&lt;enter&gt;</code> displays the help within the console, only returning after all output has been displayed.</li>
  <li><code>devenv.exe test.txt&lt;enter&gt;</code> runs the Gui (loading test.txt) returning to the console immediately</li>
  </ul></li>
  </ul>
  
  <p>So, it must be possible to have this behaviour in our own applications somehow! Does anyone know how?</p>