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: Processes
Chapter 2 - Process Manager / Process Manager Reference
Routines / Launching Applications and Desk Accessories


LaunchDeskAccessory

You can use the LaunchDeskAccessory function to launch desk accessories. Use this function only when your application needs to launch a desk accessory for some reason other than the user's choosing one from the Apple menu. (When the user chooses any Apple menu item that is not specific to your application, use the OpenDeskAcc function.)

FUNCTION LaunchDeskAccessory (pFileSpec: FSSpecPtr; 
                              pDAName: StringPtr): OSErr;
pFileSpec
A pointer to a file system specification of the resource fork to search for the specified desk accessory.
pDAName
The name of the 'DRVR' resource to launch.
DESCRIPTION
The LaunchDeskAccessory function searches the resource fork of the file specified by the pFileSpec parameter for the desk accessory with the 'DRVR' resource name specified in the pDAName parameter. If the 'DRVR' resource name is found, LaunchDeskAccessory launches the corresponding desk accessory. If the desk accessory is already open, it is brought to the front.

Use the pFileSpec parameter to specify the file to search. Specify NIL as the value of pFileSpec if you want to search the current resource file and the resource files opened before it. Otherwise, use a pointer to an FSSpec record to specify the file.

In the pDAName parameter, specify the 'DRVR' resource name of the desk accessory to launch. Specify NIL as the value of pDAName if you want to launch the first 'DRVR' resource found in the file as returned by the Resource Manager. Because the LaunchDeskAccessory function opens the specified resource file for exclusive access, you cannot launch more than one desk accessory from the same resource file.

If the 'DRVR' resource is in a resource file that is already open by the current process or if the driver is in the System file and the Option key is pressed, LaunchDeskAccessory launches the desk accessory in the application's heap. Otherwise, the desk accessory is given its own partition and launched in the system heap.

ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for the LaunchDeskAccessory function are
Trap macro Selector
_OSDispatch$0036

RESULT CODES
noErr0No error
resNotFound-192Resource not found


Previous Book Contents Book Index Next

© Apple Computer, Inc.
17 JUN 1996