From: Steven McGee <mcgee@ils.nwu.edu>
Subject: Re: Hiding the Menubar?
Organization: The Institute for the Learning Sciences
X-Useragent: Nuntius v1.1
Date: Mon, 14 Dec 1992 15:25:43 GMT

Here is a discussion that I pulled off of comp.sys.mac.programmer a while
ago. I have not tried it but it will give a starting place.

/*Code to hide the menubar*/
/*Taken from the Usenet Mac Programmer's guide, page 258-260*/
/*Call remove_menubar, passing a RgnHandle to hold the desktop region*/
/*The function returns the height of the menubar*/
/*Call restore_menubar to return everything to normal*/


void SetMBarHeight(int newheight) {
   MBarHeight = newheight;  /*MBarHeight is a low-mem global*/
}                           /*It may not be supported in the future*/


/*remove_menubar removes the menubar and adjusts the desktop*/
/* so that the menu is gone*/
/*It returns the original height of the menubar and sets gray_rgn to
the*/ /*original gray region */

int remove_menubar (RgnHandle gray_rgn) {
int old_height;
RgnHandle newgray_region;
Rect newgray_rect;
 
   old_height = GetMBarHeight();
   SetMBarHeight(0);  /*shrink menubar to 0*/

   newgray_region = NewRgn();
   CopyRgn(GetGrayRgn(),gray_rgn);
   SetRect(&newgray_rect,screenBits.bounds.left,screenBits.bounds.top,
           screenBits.bounds.right,screenBits.bounds.bottom);
   RectRgn(newgray_region,&newgray_rect);
   CopyRgn(newgray_region,GetGrayRgn());
   PaintOne((WindowPeek)0L,newgray_region);/*update desktop over menubar
rgn*/
   CalcVis((WindowPeek)0L);
   
   DisposeRgn(newgray_region);
   return old_height;
}

/*restore_menubar puts it back*/
void restore_menubar(int mbarheight,RgnHandle gray_rgn) {
RgnHandle current_region;
Rect mbarrect;
RgnHandle mbar_region;
WindowPeek front;

   SetRect(&mbarrect,screenBits.bounds.left,screenBits.bounds.top,
           screenBits.bounds.right,screenBits.bounds.top+mbarheight);
   mbar_region = NewRgn();
   RectRgn(mbar_region,&mbarrect);
   current_region = NewRgn();
   SetMBarHeight(mbarheight);
   CopyRgn(GetGrayRgn(),current_region);
   CopyRgn(gray_rgn,GetGrayRgn());
   front = (WindowPeek)FrontWindow();
   CalcVis(front);
   CalcVisBehind(front,mbar_region);
   CalcVisBehind(front,current_region);
   HiliteMenu(0);
   DrawMenuBar();
   DisposeRgn(current_region);
   DisposeRgn(mbar_region);
}

/*Steve*/

---------------------------------
In article <kePQOia00WBM04mmoS@andrew.cmu.edu>, sr0o+@andrew.cmu.edu
(Steven 
Ritter) writes:
> 
> int remove_menubar (RgnHandle gray_rgn) {
> int old_height;
> RgnHandle newgray_region;
> Rect newgray_rect;
>  
>    old_height = GetMBarHeight();
>    SetMBarHeight(0);  /*shrink menubar to 0*/
> 
>    newgray_region = NewRgn();
>    CopyRgn(GetGrayRgn(),gray_rgn);
>    SetRect(&newgray_rect,screenBits.bounds.left,screenBits.bounds.top,
>            screenBits.bounds.right,screenBits.bounds.bottom);
>    RectRgn(newgray_region,&newgray_rect);
>    CopyRgn(newgray_region,GetGrayRgn());
 
Ack! no!  Now you've just eliminated any other monitors besides your main
monitor from the desktop!

Try something like:

    SetRect(&newgray_rect, screenBits.bounds.left, screenBits.bounds.top,
            screenBits.bounds.right, old_height);
    RectRgn(newgray_region, &newgray_rect);
    UnionRgn(GrayRgn, newgray_region, GrayRgn);

or so.
--
Scott Lindsey <wombat@claris.com>