Is there any possible way to make the GetCommandLine Returns 2 paths of 2 files.
Ex:- when i use GetCommandLine it returns to me the path of the Exe(Running File) only,i want it to return two paths the Exe and another files in the same Destination is it possible?!
Posted on 2009-04-05 21:53:51 by BlackGear
GetCommandLine() returns, funnily enough, the program command line. On win32, the command line consists of the executable and the arguments given to CreateProcess, if any.

If you want to get a list of the files in the folder your executable is in, you'll have to parse out the module path (though I suggest getting it from GetModuleFileName(), specifying GetModuleHandle(0) as module handle, to be certain you're getting the right path), and then iterate the files with FindFirstFile() and FindNextFile().

Or is it something else you want?
Posted on 2009-04-06 04:05:43 by f0dder
thanx for your help,i had asked my question because i had found a app check for a file existence by GetCommandLine so i want to ask is there any way to add this file to the arguments.
Posted on 2009-04-06 05:27:47 by BlackGear
the executable filename is usually the first argument...
make a silly program which calls GetCommandLine, load up olly and look at the buffer...
Posted on 2009-04-06 10:37:09 by evlncrn8