QuickBASIC Program to Disable Apple Menu from Menu Bar (44232)






This article was previously published under Q44232

SUMMARY

The program example shown below demonstrates how to disable the Apple menu on the menu bar from a QuickBASIC program on the Apple Macintosh. The resulting Apple appears as dim gray, making its menu items nonselectable.

This information applies to Microsoft QuickBASIC Version 1.00 for the Apple Macintosh.

Code Example

The following program is DIMMENU, which demonstrates the toolbox CALL to disable (dim) the Apple Menu:
' Routine to disable Apple Menu
toolbox "i"
menuhandle& = 0

' Disable Apple Menu
toolbox "lq", &H949, 1, menuhandle&     ' GetMHandle
toolbox "pq", &H93A, (menuhandle&), 0   ' DisableItem
toolbox "pq", &H937                         ' DrawMenuBar

PRINT "Notice that the Apple menu is dimmed"
PRINT "Click the mouse button to continue..."
PRINT
WHILE MOUSE(0) <> 1 : WEND

' Restore Apple Menu
toolbox "pq", &H939, (menuhandle&), 0   ' EnableItem
toolbox "pq", &H937                         ' DrawMenuBar

PRINT "Presto, its back!"
PRINT "Click the mouse to exit"
WHILE MOUSE(0) <> 1 : WEND
				

Modification Type: Minor Last Reviewed: 1/9/2003
Keywords: KB44232