Important: The information in this document is obsolete and should not be used for new development.
LaunchDeskAccessory
You can use theLaunchDeskAccessory
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 theOpenDeskAcc
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
TheLaunchDeskAccessory
function searches the resource fork of the file specified by thepFileSpec
parameter for the desk accessory with the'DRVR'
resource name specified in thepDAName
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. SpecifyNIL
as the value ofpFileSpec
if you want to search the current resource file and the resource files opened before it. Otherwise, use a pointer to anFSSpec
record to specify the file.In the
pDAName
parameter, specify the'DRVR'
resource name of the desk accessory to launch. SpecifyNIL
as the value ofpDAName
if you want to launch the first'DRVR'
resource found in the file as returned by the Resource Manager. Because theLaunchDeskAccessory
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 theLaunchDeskAccessory
function are
Trap macro Selector _OSDispatch $0036 RESULT CODES
noErr 0 No error resNotFound -192 Resource not found