• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
How to remove the quit menu item of the Doc menu of an application?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to remove the quit menu item of the Doc menu of an application?


  • Subject: How to remove the quit menu item of the Doc menu of an application?
  • From: "Sherman He" <email@hidden>
  • Date: Wed, 12 Jan 2005 11:58:20 +0800

hi  all ,
 
Anybody knows how to remove the quit menu item of the Doc menu of an application?
 
I 've tried the code which is provided in tn2062 as following , 

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
    OSStatus error;
//Completely remove the Quit menu item
 
      MenuItemIndex outIndex;
      MenuRef applicationMenu;
      MenuRef baseMenu;
      baseMenu =  GetApplicationDockTileMenu ();
     
      error = GetIndMenuItemWithCommandID(
                NULL, kHICommandQuit, 1,
                &applicationMenu, &outIndex);
     
      DeleteMenuItem(applicationMenu, outIndex);
     
      error = GetIndMenuItemWithCommandID(
                 NULL, kHICommandHide, 1,
                 &applicationMenu, &outIndex);
      SetItemCmd(applicationMenu, outIndex,0);
 
}
 
But it doesn't work, GetIndMenuItemWithCommandID return -5622, which means the menu is not there.
 
Thank you very much.
 
Jacky zhu
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: How to remove the quit menu item of the Doc menu of an application?
      • From: "M. Uli Kusterer" <email@hidden>
    • Re: How to remove the quit menu item of the Doc menu of an application?
      • From: Andrew Farmer <email@hidden>
  • Prev by Date: Re: Obj-C NSRect methods help
  • Next by Date: Re: How to remove the quit menu item of the Doc menu of an application?
  • Previous by thread: Re: Obj-C NSRect methods help
  • Next by thread: Re: How to remove the quit menu item of the Doc menu of an application?
  • Index(es):
    • Date
    • Thread