Microsoft KB Archive/44233: Difference between revisions

From BetaArchive Wiki
m (Text replacement - "<" to "<")
m (Text replacement - "&" to "&")
 
(One intermediate revision 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 &quot;i&quot;
<pre class="codesample">toolbox &quot;i&quot;
menuhandle&amp; = 0
menuhandle& = 0
' Delete Apple Menu:
' Delete Apple Menu:
toolbox &quot;lq&quot;, &amp;H949, 1, menuhandle&amp;   ' GetMHandle
toolbox &quot;lq&quot;, &H949, 1, menuhandle&  ' GetMHandle
toolbox &quot;pq&quot;, &amp;H936, 1                ' DeleteMenu
toolbox &quot;pq&quot;, &H936, 1                ' DeleteMenu
toolbox &quot;pq&quot;, &amp;H937                  ' DrawMenuBar
toolbox &quot;pq&quot;, &H937                  ' DrawMenuBar
PRINT &quot;Notice that the Apple menu is deleted&quot;
PRINT &quot;Notice that the Apple menu is deleted&quot;
PRINT &quot;Click the mouse button to continue...&quot;
PRINT &quot;Click the mouse button to continue...&quot;
PRINT
PRINT
WHILE MOUSE(0) <&gt; 1 : WEND
WHILE MOUSE(0) <> 1 : WEND


' Restore Apple Menu
' Restore Apple Menu
toolbox &quot;pq&quot;, &amp;H935, (menuhandle&amp;), 2  ' InsertMenu
toolbox &quot;pq&quot;, &H935, (menuhandle&), 2  ' InsertMenu
toolbox &quot;pq&quot;, &amp;H937                    ' DrawMenuBar
toolbox &quot;pq&quot;, &H937                    ' DrawMenuBar
PRINT &quot;Presto, its back!&quot;
PRINT &quot;Presto, its back!&quot;
PRINT &quot;Click the mouse to exit&quot;
PRINT &quot;Click the mouse to exit&quot;
WHILE MOUSE(0) <&gt; 1 : WEND
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&amp; = &amp;HA934
<pre class="codesample">ClearMenuBarTrap& = &HA934
DrawMenuBarTrap&amp; = &amp;HA937
DrawMenuBarTrap& = &HA937
ToolBox &quot;I&quot;
ToolBox &quot;I&quot;
ToolBox &quot;PQ&quot;,ClearMenuBarTrap&amp;
ToolBox &quot;PQ&quot;,ClearMenuBarTrap&
ToolBox &quot;PQ&quot;,DrawMenuBarTrap&amp;
ToolBox &quot;PQ&quot;,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

Knowledge Base


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