Important: The information in this document is obsolete and should not be used for new development.
GetAppParms
You can use theGetAppParms
procedure to get information about the current application and about files selected by the user for opening or printing.
PROCEDURE GetAppParms(VAR apName: Str255; VAR apRefNum: Integer; VAR apParam: Handle);
apName
- On output, the name of the calling application.
apRefNum
- On output, the reference number of the application's resource file.
apParam
- On output, a handle to the Finder information about files to open or print.
DESCRIPTION
TheGetAppParms
procedure returns information about the current application. You can callGetAppParms
at application launch time to determine which files, if any, the user has selected in the Finder for opening or printing. You can callGetAppParms
at any time to determine the current application's name and the reference number of the application's resource fork.The
GetAppParms
procedure returns the application's name in theapName
parameter and the reference number of its resource fork in theapRefNum
parameter. A handle to the Finder information is returned inapParam
. This information consists of a word that encodes the message or action to be performed, a word that indicates how many files to process, and a list of Finder information about each such file. The Finder information has the structure of anAppFile
record, except that the filename occupies only as many bytes as are required to hold the name (padded to an even number of bytes, if necessary). In general, it is easier to use theGetAppFiles
procedure to access the Finder information.SPECIAL CONSIDERATIONS
If you simply want to determine the application's resource file reference number, you can call the Resource Manager functionCurResFile
when your application starts up.If you need more extensive information about the application than
GetAppParms
provides, you can use the Process Manager functionGetCurrentProcess
.ASSEMBLY-LANGUAGE INFORMATION
You can get the application's name, reference number, and handle to the Finder information directly from the global variablesCurApName
,CurApRefNum
, andAppParmHandle
.