I've been using the CreateProcess Win API, and I was wondering what the difference was between using the lpApplicationName and lpCommandLine for arguments v.s. just the lpCommandLine parameter.
For example:
CreateProcess(NULL, L"C:\Path\To\Notepad.exe", L"C:\Path\To\File\To\Load.txt"... etc
CreateProcess(NULL, NULL, L"C:\Path\To\Notepad.exe C:\Path\To\File\To\Load.txt"... etc
I assume that the second option, where only lpCommandLine is used would be like opening up cmd.exe and running that exact line. But what about the first line, is it loading up the application and specifying the command line arguments differently?
I've had a look at the MSDN documentation for the API but it doesn't seem to really detail whats happening, that what that parameters can contain, which is fine, but I'm just confused about what I should be doing when there are multiple ways to do it.
Please note, I know the two sample lines may not work as lpCommandLine requires a LPTSTR, not LPCTSTR. Its just for ease of understanding.
Thanks a lot for any help!
Andy