On Sat, 12 Feb 2000 10:22:43 +0000 Dave Cragg <[EMAIL PROTECTED]>
writes:
> But there's a gotcha I think. If the standalone is already open,
> double-clicking on an associated file will open a new instance of
> the standalone. I remember there was a discussion on this a long time
> ago. I can't remember anyone coming up with a way to allow a
> double-clicked file to be handled by an already open standalone.
With a little work, and DDE(via the external collection) it can be done.
Here's an example of how:
1) Open the Windows file association dialog, select the MetaCard stack
file type then click "Edit".
2) Select the Open action from the "Edit File Type" dialog, and click
"Edit".
3) Hilite the "use DDE" button and fill in the following fields:
a) DDE Message - [FileOpen("%1")] #can be anything but %1 is replaced
with the path of the file opened
b) Application - EXT #this is our DDE server
c) Topic - System
4) Now click OK and close the file association dialog.
5) Start MetaCard then open External Collection Demo stack.
6) Go to the DDE sample card and click "Initialize Server".
7) Now that our DDE server is up and running, try double clicking a
MetaCard file from the OS.
8) If everything is working right, the External Collection stack recieved
the DDE message and the string "FileOpen" and the name of the file you
clicked on should be displayed in the message box.
9) When finished seeing how this all works... reopen the Windows File
association dialog, select and edit the MetaCard file type like before,
then unhilite the "use DDE" button from the "Edit File Type" dialog.
Everything should go back to working like it did before you started step
1.
You can use this knowledge to set up an install script which registers
your custom file type programmatically. Like in the above example a DDE
message would be sent to your MetaCard application whenever that custom
file type is opened from the OS. An application should call ext_ddeopen
on startup to prevent any useless error messages from popping up if
double clicking a file when the application is not open.
Hope this helps,
Tuviah Snyder
Diskotek
Custom Application Development & SuperCard/HyperCard Conversion at a low
price
This is the MetaCard mailing list.
Archives: http://www.mail-archive.com/metacard%40lists.best.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm