I’m writing a C++ program for a Windows 7 user which will be the default program called when she double-clicks certain files (.ora files) and I need to know how I can essentially pass in to the program the file name [including path] that she is trying to open. Since the program won’t be running at the time of file selection, I can’t use mouse events to cheat… How can I have a Win32 platform C++ program figure out what file called it?
thanks,
CCJ
When double-clicking a file results in opening an executable, the path and name of the file are passed as the first command line argument.
Since the first entry in argv is the path to the executable, you are interested in the second argument, argv[1].