Important: The information in this document is obsolete and should not be used for new development.
LaunchDeskAccessory
You can use theLaunchDeskAccessoryfunction 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 theOpenDeskAccfunction.)
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
TheLaunchDeskAccessoryfunction searches the resource fork of the file specified by thepFileSpecparameter for the desk accessory with the'DRVR'resource name specified in thepDANameparameter. If the'DRVR'resource name is found,LaunchDeskAccessorylaunches the corresponding desk accessory. If the desk accessory is already open, it is brought to the front.Use the
pFileSpecparameter to specify the file to search. SpecifyNILas the value ofpFileSpecif you want to search the current resource file and the resource files opened before it. Otherwise, use a pointer to anFSSpecrecord to specify the file.In the
pDANameparameter, specify the'DRVR'resource name of the desk accessory to launch. SpecifyNILas the value ofpDANameif you want to launch the first'DRVR'resource found in the file as returned by the Resource Manager. Because theLaunchDeskAccessoryfunction 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,LaunchDeskAccessorylaunches 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 theLaunchDeskAccessoryfunction are
Trap macro Selector _OSDispatch $0036 RESULT CODES
noErr 0 No error resNotFound -192 Resource not found