Page 1 of 1
How does windows pass file name info when file is clicked?
Posted: Sat Feb 09, 2013 5:12 pm
by magice
Ok this may be a stupid question. In order for the end user of my app to save, I have a compiled stack that loads an un-compiled template stack. From inside the compiled stack, the user chooses "new" or "saved" If he chooses "new", the template stack is copied and the new copy is opened. if the user chooses "saved" the saved stack is copied and the copy is opened. This works perfectly for my needs, however i would like the user to be able to double click the saved file and have it open in the app. I think I have the file association part figured out, but i need to know how windows passes the file name to the app so I can run the opening process at startup without asking for the file name.
Re: How does windows pass file name info when file is clicke
Posted: Sat Feb 09, 2013 6:45 pm
by FourthWorld
Re: How does windows pass file name info when file is clicke
Posted: Mon Feb 11, 2013 3:50 pm
by magice
Thank you. I believe that is exactly what I needed.
Re: How does windows pass file name info when file is clicke
Posted: Tue Feb 12, 2013 2:49 am
by magice
I am still having a bit of trouble with this. Here is the code I am using, based on the given example:
Code: Select all
get setRegistry("HKEY_CLASSES_ROOT\.tmm\","TileMapper")
answer it
get setRegistry("HKEY_CLASSES_ROOT\TileMapper\","TileMapper document")
answer it
get setRegistry("HKEY_CLASSES_ROOT\TileMapper\DefaultIcon\","D:\Program Files\RPGenius\TileMapper.exe,1")
answer it
get setRegistry("HKEY_CLASSES_ROOT\TileMapper\shell\open\command\","D:\Program Files\RPGenius\TileMapper.exe %1")
answer it
The answer lines are there to help me figure out what I did wrong.
The first entry is going in fine, and answering true. The other 3 are not and are answering false. So, for some reason the registry is not taking them. Maybe you can see something wrong with my entries that I am missing.
Re: How does windows pass file name info when file is clicke
Posted: Thu Feb 14, 2013 2:01 am
by magice
I figured out that previous attempts were causing the registry entries to not go through and that I needed to delete those entries first. After that it worked to an extent. I still am having 1 issue. After these registry entries are made, the icon is correct but windows gives an error when the file is clicked saying "Windows cannot access the specified device, path,or file. You may not have the appropriate permission to access the item." If I do a "Open with" and set the default application it works. So what in my registry entries am I missing? I checked the file path and that seem correct.
Re: How does windows pass file name info when file is clicke
Posted: Thu Feb 14, 2013 4:27 am
by magice
Nevermind...I figured out how to get Inno Setup to do it for me.