title: Breaking down WinMain's cmdLine in old style main()'s arguments
body: <p>I want to convert <code>WinMain</code>'s <code>cmdLine</code> argument to <code>argc</code> and <code>argv</code> so I can use the argument parsing function I wrote for console applications.</p>
  
  <p>This would be trivial except that I want to support "quotes" too. For example:</p>
  
  <p><code>test.exe test1 test2 "testing testing"</code></p>
  
  <p>should be</p>
  
  <pre><code>argv[0] = "test.exe"; argv[1] = "test1"; argv[2] = "test2"; argv[3] = "testing testing";
  </code></pre>
  
  <p>I realize that cmdLine doesn't have the program name (the argv[0]); this doesn't matter I can use a dummy value.</p>
  
  <p>I was thinking of doing it with a regex, <code>(("[^"]+")\s+)|(([^\s]+)\s*)</code> I'm not sure how well it would work though.. Probably not very well? Is there any function to do that in the windows api? Thanks</p>