Setting Document Associations in Windows

Ken Ray kray at sonsothunder.com
Fri Feb 13 14:35:57 EST 2004


> [ 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.

Icons are stored as resources inside of the application itself. Most
applications like Word, etc. have more than one icon stored there, and
they are retrieved from the Registry in the order that they exist in the
application. So the first icon is in the first position, the second icon
in the second position, etc.

> "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.

Well, if you don't have that, you won't be able to open the file the
user double-clicked from the desktop. It shouldn't affect how the icon
is displayed, however.
 
> 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. 

Did you provide a document icon in the Distribution Builder? If not,
you'll need to use an icon editor on your standalone to change the
default document icon to your document icon.

Ken Ray
Sons of Thunder Software
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/ 





More information about the use-livecode mailing list