[futurebasic] Re: [FB] Hide apple menu

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : June 2014 : Group Archive : Group : All Groups

From: Brian S <fblistserve@...>
Date: Fri, 13 Jun 2014 22:55:00 -0700
Bill Tomlinson wrote:

> anyway it would solve my problem if I could get rid of the Minesweeper menu, which i believe is menuid=0.

I don’t agree with that assessment but here is some code to get you close:
'----------------------------
include "Tlbx Menus.incl"

local fn DisableAppMenu
'~'1
dim as MenuRef m : m  = NULL
dim as CFIndex count

m = fn GetMenuHandle( _appleMenu )

if ( m == NULL )
fn GetIndMenuItemWithCommandID( 0, _kHICommandAbout, 1, @m, NULL )
if ( m == NULL ) then fn GetIndMenuItemWithCommandID( 0, _kHICommandQuit, 1, @m, NULL )
end if

if ( m )
count = fn CountMenuItems( m )
DisableMenuItem( m, count )
fn DeleteMenuItems( m, 1, count - 1 )
end if

end fn

fn DisableAppMenu

do
handleEvents
until ( gFBQuit )    // RunApplicationEventLoop() can be used instead of do/until loop.
'----------------------------

It’s been a while since I’ve written Carbon and even then it was Carbon Events and not FB Events, so the above might have flaws.

Brian