Microsoft KB Archive/44233: Difference between revisions
From BetaArchive Wiki
(importing KB archive) |
m (Text replacement - "&" to "&") |
||
(2 intermediate revisions by the same user not shown) | |||
Line 48: | Line 48: | ||
The following program demonstrates a ToolBox call to delete, then restore the Apple Menu: | The following program demonstrates a ToolBox call to delete, then restore the Apple Menu: | ||
<pre class="codesample">toolbox "i" | <pre class="codesample">toolbox "i" | ||
menuhandle& | menuhandle& = 0 | ||
' Delete Apple Menu: | ' Delete Apple Menu: | ||
toolbox "lq", & | toolbox "lq", &H949, 1, menuhandle& ' GetMHandle | ||
toolbox "pq", & | toolbox "pq", &H936, 1 ' DeleteMenu | ||
toolbox "pq", & | toolbox "pq", &H937 ' DrawMenuBar | ||
PRINT "Notice that the Apple menu is deleted" | PRINT "Notice that the Apple menu is deleted" | ||
PRINT "Click the mouse button to continue..." | PRINT "Click the mouse button to continue..." | ||
PRINT | PRINT | ||
WHILE MOUSE(0) | WHILE MOUSE(0) <> 1 : WEND | ||
' Restore Apple Menu | ' Restore Apple Menu | ||
toolbox "pq", & | toolbox "pq", &H935, (menuhandle&), 2 ' InsertMenu | ||
toolbox "pq", & | toolbox "pq", &H937 ' DrawMenuBar | ||
PRINT "Presto, its back!" | PRINT "Presto, its back!" | ||
PRINT "Click the mouse to exit" | PRINT "Click the mouse to exit" | ||
WHILE MOUSE(0) | WHILE MOUSE(0) <> 1 : WEND | ||
</pre> | </pre> | ||
=== Example 2 === | === Example 2 === | ||
The following code example completely erases (clears) the Apple menu plus all the remaining top menu bar items: | The following code example completely erases (clears) the Apple menu plus all the remaining top menu bar items: | ||
<pre class="codesample">ClearMenuBarTrap& | <pre class="codesample">ClearMenuBarTrap& = &HA934 | ||
DrawMenuBarTrap& | DrawMenuBarTrap& = &HA937 | ||
ToolBox "I" | ToolBox "I" | ||
ToolBox "PQ",ClearMenuBarTrap& | ToolBox "PQ",ClearMenuBarTrap& | ||
ToolBox "PQ",DrawMenuBarTrap& | ToolBox "PQ",DrawMenuBarTrap& | ||
' Now, any QuickBASIC MENU definitions can be executed from here on. | ' Now, any QuickBASIC MENU definitions can be executed from here on. | ||
' They can be placed in the upper left corner where the Apple | ' They can be placed in the upper left corner where the Apple |
Latest revision as of 14:14, 21 July 2020
Article ID: 44233
Article Last Modified on 11/21/2006
This article was previously published under Q44233
SUMMARY
The program examples below demonstrate how to delete the Apple menu from the menu bar in a QuickBASIC program on the Apple Macintosh.
Example 1 deletes only the Apple menu, leaving any other existing menus. Example 2 clears the Apple menu plus all existing menus.
This information applies to Microsoft QuickBASIC Version 1.00 for Apple Macintosh.
MORE INFORMATION
Example 1
The following program demonstrates a ToolBox call to delete, then restore the Apple Menu:
toolbox "i" menuhandle& = 0 ' Delete Apple Menu: toolbox "lq", &H949, 1, menuhandle& ' GetMHandle toolbox "pq", &H936, 1 ' DeleteMenu toolbox "pq", &H937 ' DrawMenuBar PRINT "Notice that the Apple menu is deleted" PRINT "Click the mouse button to continue..." PRINT WHILE MOUSE(0) <> 1 : WEND ' Restore Apple Menu toolbox "pq", &H935, (menuhandle&), 2 ' InsertMenu toolbox "pq", &H937 ' DrawMenuBar PRINT "Presto, its back!" PRINT "Click the mouse to exit" WHILE MOUSE(0) <> 1 : WEND
Example 2
The following code example completely erases (clears) the Apple menu plus all the remaining top menu bar items:
ClearMenuBarTrap& = &HA934 DrawMenuBarTrap& = &HA937 ToolBox "I" ToolBox "PQ",ClearMenuBarTrap& ToolBox "PQ",DrawMenuBarTrap& ' Now, any QuickBASIC MENU definitions can be executed from here on. ' They can be placed in the upper left corner where the Apple ' menu was and stretch across the menu bar.
Additional query words: MQuickB
Keywords: KB44233