on 10/11/02 5:56 AM, Shari at [EMAIL PROTECTED] wrote:
I have a standalone, with embedded stacks, and with external stacks.
The standalone has a creator code and custom icons, and all is well.
I want the external stacks to also have custom icons, different from
the standalone, but nothing I've tried gets the icons to stick.
Setting the creator code to the same as the standalone, and creating
the various icon resources, works until the stack is opened. The
moment the stack is opened, Metacard itself changes the creator code
to Metacard's, and Metacard's icons replace mine. I've tried with
and without bundle bits, and with various settings checked in the Get
File Info item of ResEdit.
Even when the standalone opens the stack, and Metacard itself is not
running except the embedded portion of the standalone, the icons
change back to Metacard's. And the standalone and stack, neither
have Metacard's icons in the resource fork.
What specifically, needs to be done, to have stacks with custom
icons? The stacks are part of the standalone program, mostly to save
data into, but have other uses as well.
I did not set a new file type for the stacks, as Metacard needs to
recognize them and treat them as stacks.
Walk me thru it guys, for I am baffled (again :-)
Shari C
Shari,
To set the proper document associations on a Mac, get into ResEdit and study
other documents of other programs. A littl experimentation should help you
do it in your own. It takes more than just the Get File/Folder Info part of
ResEdit.
To set the proper document associations with your app, you can follow the
directions in the tip on Ken Ray's web site:
http://www.sonsothunder.com/devres/metacard/metacard.htm?file004
I'll also include for you, below, what Ken sent me on it.
Good Luck,
Ray Horsley
Developer, LinkIt! Software
From Ken Ray:
Setting Document Associations in Windows
(Windows Only)
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?
For the purposes of this example, I will assume a fictitious app called
TestApp, with a file extension of .tst and an installed location of
C:\Program Files\TestApp\TestApp.exe.
1) Create a key in HKEY_CLASSES_ROOT for the extension, and use the default
value to point to the name of the application:
get setRegistry(HKEY_CLASSES_ROOT\.tst\,TestApp)
2) Create a key in HKCR for the application itself, using the default value
to point to a descriptor of the kind of document used by the app - this will
be used in list views to show the kind of file a document of TestApp is:
get setRegistry(HKEY_CLASSES_ROOT\TestApp\,TestApp document)
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:
get setRegistry(HKEY_CLASSES_ROOT\TestApp\DefaultIcon\,C:\Program
Files\TestApp\TestApp.exe,1)
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)
OK, now you have all the registry settings. The next thing to do is add some
code to your app. When you launch an MC/Rev app, any command line
information is sent to the application and is retrievable via *environment
variables* numbered $0 on up. The $0 variable will always contain the path
to the application you just launched, and the $1 will contain the first
command-line parameter passed ($2 will be the second, etc.).
So some simple code for this is:
on openStack
put $0 into theAppPath
put $1 into theDocToOpen
answer The doc to open is: theDocToOpen
end openStack
(Note that you'll need to bundle in the answer dialog box to your standalone
or you'll never see the message. ;-)
That's it! The next time you create a document with a .tst extension, it
will take on the icon in the first position in the TestApp executable (the
document icon), and if you double-click it, it will launch TestApp and its
path will be passed to the standalone as $1.
Hope this clears things up...
Posted 7/24/2002 by Ken Ray to the Use Revolution List (See the complete