Apparently, the command line is returned different for a console
program and a Win GUI program. I get the --
"c:\bxcon\bxcon.exe program agrs" with a console app.
With a GUI app I get just the program ars. Is this correct?
TIA
program and a Win GUI program. I get the --
"c:\bxcon\bxcon.exe program agrs" with a console app.
With a GUI app I get just the program ars. Is this correct?
TIA
No, the GUI one's command line is also "c:\bxcon\bxcon.exe program agrs".
Peculiar thing is, I get something like:
"E:\masm32\ggwin\gmen.exe"
when starting from Windows Explorer, but:
E:\masm32\ggwin\gmen.exe
when starting from QEditor!
BUT if the path is say:
e:\masm32\ggwin\gmen temp.exe
QEditor also gives the same result as Win Explorer...
"E:\masm32\ggwin\gmen temp.exe"
"E:\masm32\ggwin\gmen.exe"
when starting from Windows Explorer, but:
E:\masm32\ggwin\gmen.exe
when starting from QEditor!
BUT if the path is say:
e:\masm32\ggwin\gmen temp.exe
QEditor also gives the same result as Win Explorer...
"E:\masm32\ggwin\gmen temp.exe"
I think the quotes are used if there are spaces...
Yes QEditor does that, but WinExplorer always gives "" regardless of whether or not spaces are in the path. This is in Win98SE BTW.
Shlwapi.inc - PathUnquoteSpaces
will remove those quotes.
will remove those quotes.
Unfortunately what turns up as a command line varies from windows version to another and from app to app in each version,WinExec/CreateProcess, command prompt, Winfile and Explorer all treat the command line differently, some add quotes around all the text, some don't so do it only when there are long file names.
I have used the SHLWAPI functions to try and get it to work across more versions but the range of variations seem to beat it.
Funny I never get the problem on any of my own boxes, I set them up from scratch to show all files and extension types so I have never been able to test it as every case works OK on my own machines.
I get the idea that Microsoft is not all that interested in providing a consistent command line system for windows.
Regards,
hutch@movsd.com
I have used the SHLWAPI functions to try and get it to work across more versions but the range of variations seem to beat it.
Funny I never get the problem on any of my own boxes, I set them up from scratch to show all files and extension types so I have never been able to test it as every case works OK on my own machines.
I get the idea that Microsoft is not all that interested in providing a consistent command line system for windows.
Regards,
hutch@movsd.com
Shlwapi has some very handy functions indeed. I use them alot. Saves a lot of time I would otherwise spend coding a proc or lib function. Plus saves code space which is a big plus with me.
Slightly OT but for those who need to search for a specific file, Imghlp.lib (and Dbghelp.lib - i think) has the "SearchTreeForFile" function which can search a path (the whole disk if you specify the root) for the first occurance of a specific file.
Slightly OT but for those who need to search for a specific file, Imghlp.lib (and Dbghelp.lib - i think) has the "SearchTreeForFile" function which can search a path (the whole disk if you specify the root) for the first occurance of a specific file.
The logic for handling all commandline variations is not very hard -
it's pretty trivial string operations with a few if's and for loops.
it's pretty trivial string operations with a few if's and for loops.