Microsoft KB Archive/39095

From BetaArchive Wiki
Knowledge Base

How to Pop Up a Desk Accessory from Macintosh QuickBASIC

Article ID: 39095

Article Last Modified on 1/8/2003


  • Microsoft QuickBasic Compiler for Macintosh 1.0

This article was previously published under Q39095


A Macintosh QuickBASIC program can make a desired desk accessory pop up (as the front-most window) by using the TOOLBOX statement to invoke the OpenDeskAcc ROM trap.

To open a desk accessory with the TOOLBOX trap, OpenDeskAcc, you must pass the desk accessory name beginning with a null (zero-value) byte, i.e., CHR$(0), as shown below.


The code example below will pop up the Control Panel desk accessory from a QuickBASIC program. Changes that you make in the Control Panel settings are retained after termination of the program. All currently-installed Macintosh desk accessories can be popped up in this manner.

The desk accessories are located in the Apple menu in the upper left corner of the Macintosh Desktop. You can install/un-install desk accessories with the Font/DA Mover program provided on most Apple System disks. Common desk accessories include the Control Panel, Chooser, Scrapbook, and Calculator.

The following is a code example:

Toolbox "i"
deskacc$ = CHR$(0) + "Control Panel"  'Null byte before name
refnum% = 0
Toolbox "WQ", &H9B6, deskacc$, refnum%

Additional query words: MQuickB

Keywords: KB39095