Important: The information in this document is obsolete and should not be used for new development.
GetAppParms
You can use theGetAppParmsprocedure 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
TheGetAppParmsprocedure returns information about the current application. You can callGetAppParmsat application launch time to determine which files, if any, the user has selected in the Finder for opening or printing. You can callGetAppParmsat any time to determine the current application's name and the reference number of the application's resource fork.The
GetAppParmsprocedure returns the application's name in theapNameparameter and the reference number of its resource fork in theapRefNumparameter. 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 anAppFilerecord, 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 theGetAppFilesprocedure 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 functionCurResFilewhen your application starts up.If you need more extensive information about the application than
GetAppParmsprovides, 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.