I have associated a file extension with my program. In the Windows registry this shows up as a key under HKCR that looks something like this:
shell\open\command(Standard) "c:\blabla\MyProgram.exe" "%1"
When I doubleclick a file with the appropriate extension, my application is launched with the full pathname of the file as an argument. This is exactly what I want, so that is good.
Furthermore, the current directory of the program is set to the directory of the file I clicked. This is not what I want; so is there any way to specify that another directory should be used as current directory instead of the container of the clicked file?
(I realize that I can add an argument to my program with the appropriate current directory and then have the program switch to that directory; I just wonder if there is a standard way of doing this that I'm not aware of.)
According to your situation ,there is no way to know what the "current directory" is. so you have to pass the "current direcoty"(just like what you did currently) and change the program to parse the parameter.
the %1 alike parameter ,I guess ,have the same format as command line ,