First I hope I am posting this is the correct group, if I'm not I
apologize for any inconvenience and hope someone can point me in the
right direction.
What I have is a file extension which has been registered in the
Registry, and when I double click the file with that particular
extension my application is started. This part is working fine,
however, there are 2 important pieces of data that I need from the
file double clicked. Right my application is started, then the user
needs to go to file open and select the file. Is there a way for my
application to recognize that a file with a registered extension has
been double clicked? Also, if this is possible, is the file and path
that was double clicked sent to my application?
If this doesn't make any sense please post any questions and I will
try to elaborate as best I can on what I am trying to ask above.
Thanks everyone and any response is greatly appreciated!
Regards,
CLR
Thanks!
ch...@dagran.com (Chris) wrote in message news:<736fadb1.03101...@posting.google.com>...
(sorry that's a really long URL. Or you can google for "Verbs and
File Associations".)
Use %1 to specify where the filename should go.
You can add "%1" at the end of the shell open command of your registered
extension. This will make your program start with the full name and path
of the file double-clicked at its command line. You can get the command
line from WinMain's parameter, or use GetCommandLine() later.
For example:
HKCR\YourFileClass\shell\open\command
@="C:\...\YourProgram.exe" %1
Note, however, that this will cause your application to start a new
instance for every file clicked. If you want all files to be opened on
the same window (e.g. an MDI interface), you either have to use DDE or
some sort of IPC to inform the previous instance of the new file.
You probably should put quotation marks around the "%1" so your
program will handle files which have spaces in the name.
Regards!
ch...@dagran.com (Chris) wrote in message news:<736fadb1.03101...@posting.google.com>...