How does windows pass file name info when file is clicked?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
magice
Posts: 457
Joined: Wed Mar 18, 2009 12:57 am

How does windows pass file name info when file is clicked?

Post by magice » Sat Feb 09, 2013 5:12 pm

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.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: How does windows pass file name info when file is clicke

Post by FourthWorld » Sat Feb 09, 2013 6:45 pm

Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

magice
Posts: 457
Joined: Wed Mar 18, 2009 12:57 am

Re: How does windows pass file name info when file is clicke

Post by magice » Mon Feb 11, 2013 3:50 pm

Thank you. I believe that is exactly what I needed.

magice
Posts: 457
Joined: Wed Mar 18, 2009 12:57 am

Re: How does windows pass file name info when file is clicke

Post by magice » Tue Feb 12, 2013 2:49 am

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.

magice
Posts: 457
Joined: Wed Mar 18, 2009 12:57 am

Re: How does windows pass file name info when file is clicke

Post by magice » Thu Feb 14, 2013 2:01 am

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.

magice
Posts: 457
Joined: Wed Mar 18, 2009 12:57 am

Re: How does windows pass file name info when file is clicke

Post by magice » Thu Feb 14, 2013 4:27 am

Nevermind...I figured out how to get Inno Setup to do it for me.

Post Reply