[comp.sys.mac.programmer] Passing finder information during a "Launch" command

iand@munnari.oz (Ian Robert Dobson) (11/27/88)

I am writing an application in which I want to be able to launch (NOT
sublaunch) to other applications while passing the same information that
the Finder does when it launches an application (so I can specify a
document to open).  Since the application heap will get cleared when my
application dies, how do I ensure that the finder information sticks
around.  Also, do I just store the handle to the information in the same
low-mem globals I can get it from, or is there something more to do?

Ian R. Dobson
University of Melbourne
munnari.oz!iand

holland@m2.csc.ti.com (Fred Hollander) (11/28/88)

In article <2590@munnari.oz> iand@munnari.oz (Ian Robert Dobson) writes:
>I am writing an application in which I want to be able to launch (NOT
>sublaunch) to other applications while passing the same information that
>the Finder does when it launches an application (so I can specify a
>document to open).  Since the application heap will get cleared when my

The information that the application gets is in the global AppParmHandle.
I don't recall the exact structure, but there is a document count, followed
by a structure for each document that includes the filename, vRefNum and
file type.

>application dies, how do I ensure that the finder information sticks
>around.  Also, do I just store the handle to the information in the same
>low-mem globals I can get it from, or is there something more to do?

The information should remain intact until the application clears it or
until you return to the Finder.

Fred Hollander
Computer Science Center
Texas Instruments, Inc.
holland%ti-csl@csnet-rela

The above statements are my own and not representative of Texas Instruments.

odawa@well.UUCP (Michael Odawa) (11/29/88)

In article <2590@munnari.oz> iand@munnari.oz (Ian Robert Dobson) writes:
>I am writing an application in which I want to be able to launch (NOT
>sublaunch) to other applications while passing the same information that
>the Finder does when it launches an application (so I can specify a
>document to open).  Since the application heap will get cleared when my
>application dies, how do I ensure that the finder information sticks
>around.

The information you are referring to is contained in a block which is pointed
to by the AppParmHandle ($AEC).  The block is located in the System Heap, so
it hangs aroung automatically when the Application Heap is reinitialized.

What you want to do is grab the block, resize it, and then stuff it with your
own values.  See the structure described in IM II-56.