Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Files /
Chapter 1 - Introduction to File Management / File Management Reference
Application Launch File Routines /


GetAppParms

You can use the GetAppParms 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
The GetAppParms procedure returns information about the current application. You can call GetAppParms at application launch time to determine which files, if any, the user has selected in the Finder for opening or printing. You can call GetAppParms 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 the apName parameter and the reference number of its resource fork in the apRefNum parameter. A handle to the Finder information is returned in apParam. 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 an AppFile 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 the GetAppFiles 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 function CurResFile when your application starts up.

If you need more extensive information about the application than GetAppParms provides, you can use the Process Manager function GetCurrentProcess.

ASSEMBLY-LANGUAGE INFORMATION
You can get the application's name, reference number, and handle to the Finder information directly from the global variables CurApName, CurApRefNum, and AppParmHandle.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
2 JUL 1996