GetAppParms
GetAppParms Get application name, resource file reference, et.al.
#include <SegLoad.h> Segment Loader
void GetAppParms(apName, resRefNum, hParms );
Str255 apName ; address of buffer; receives app's filename
short *resRefNum ; receives file ref num of app's resource file
Handle *hParms; receives handle leading to file parameters
You can use GetAppParms to obtain your application's filename, your
resource fork's file reference number, and a handle. The handle leads to the list
of Finder file information about documents that were selected when your
program was launched.
apName is the address of a 32-byte buffer. Upon return, it is filled with a
length-prefixed pascal-style string containing the name of the
currently executing application.
resRefNum is the file reference number of the application resource file(fork).
You could use this to CloseResFile, UseResFile, FSRead, etc.
hParms is the address of a 4-byte Handle. Upon return, it will contain a
Handle leading to information about the files selected in the Finder
when your application was opened. The format of this data is
described in the AppFile topic.
Returns: none

Notes: There are other ways to get information besides GetAppParms:
You can get the fRefNum of your open resource file by calling
CurResFile early on.
Use CountAppFiles and GetAppFiles to index easily through the Finder
information about documents you're supposed to process.
Furthermore, you can examine the global variables CurApName (at
0x0910), CurApRefNum (at 0x0900), and AppParmHandle (at 0x0AEC).