Setting Document Associations in Windows

Mark Brownell gizmotron at earthlink.net
Fri Feb 13 13:47:06 EST 2004


Hi,

 From this old thread in the archives:
 > How do I go about setting up basic file association via
 > the registry and how do I get the Rev standalone to recognize that it 
was
 > launched with incoming parameters and access & use those parameters?

this works:
get setRegistry("HKEY_CLASSES_ROOT\.tst\","TestApp")

this works:
get setRegistry("HKEY_CLASSES_ROOT\TestApp\","TestApp document")

this works:
get setRegistry("HKEY_CLASSES_ROOT\TestApp\DefaultIcon\","C:\Program 
Files\TestApp\TestApp.exe,1")

[ Part of the last one above.
This worked but I'm not sure what this is about:

"3) Create a subkey of HKCR\TestApp to hold the default icon for the 
application. The value used is the path to the application followed by 
a comma, followed by the index of the icon resource inside the 
application. MetaCard/Rev document icons are in the first position and 
I'll assume for this example that I have used an icon editor to change 
the icon in the first position of the TestApp executable:" ]

What is the first position? Anyway my icon appears now in the top of 
the window.

Now the big question!

This does not work the way I want it to:

"4) Create a subkey three layers deep in HKCR\TestApp to hold the 
command to open the application when the document with the ".tst" 
extension is launched. The path to the document is defined in the 
registry as %1. Any other info you want to pass to the application you 
can add to this line. The nice thing about MC/Rev is that you can 
create all these keys at once in a single command:

get 
setRegistry("HKEY_CLASSES_ROOT\TestApp\shell\open\command\","C:\Program 
Files\TestApp\TestApp.exe %1") "

My guess is that I'm missing an on openStack handler that then opens 
the correct document if I call this "put $1 into theDocToOpen" kind of 
thing and then pass it to a file open handler.

So I probably answered my own question on this. I can't get my 
documents saved to display  the MTML icon when they are created using 
the standalone app. They do open my standalone but as I said they don't 
load in yet. Is there a get setRegistry() that I can use to associate 
icons with my created .mtml documents?

I have selected this icon for the application and the documents created 
in the DB during creation of the standalone app.

I'm testing on Win XP pro, Rev 2.1.2 with a proper 766 byte icon.

Thanks for any help,

Mark





More information about the use-livecode mailing list