title: How can you open a file with the program associated with its file extension?
body: <p>Is there a simple way to open a file by its associated program in windows?
  (like double clicking it in windows explorer but done automatically with my code)</p>
  
  <p>For example, on computer A, "text.txt" will be opened in wordpad but on computer B it will be opened by Notepad++ because of the users file extension assignments.</p>
  
  <p>I tried ShellExecute</p>
  
  <pre><code>ShellExecute(0, L"open", L"c:\\windows\\notepad.exe" ,L"c:\\outfile.txt" , 0 , SW_SHOW );
  </code></pre>
  
  <p>which works but if I omit the notepad.exe parameter weird things happen (a random explorer is shown).</p>