• 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
Re: 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]

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


  • Subject: Re: How to remove the quit menu item of the Doc menu of an application?
  • From: "M. Uli Kusterer" <email@hidden>
  • Date: Wed, 12 Jan 2005 07:38:07 +0100

At 11:58 Uhr +0800 12.01.2005, Sherman He wrote:
      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);

Shouldn't you be passing a menu to GetIndMenuItemWithCommandID() instead of NULL?


But I agree with Andreas, you shouldn't do that. You'll have your app's icon sitting in the dock without a way to remove it. Unless you're in business for nagware, adware and spyware, that's hardly desirable. Instead, you may want to split your app in two parts: A daemon, which is a constantly running background app (see the NSUIElement and NSBackgroundOnly flags for your Info.plist), and a GUI app which the user can launch to manage the app.

It's especially popular to make the GUI app a SystemPreferences.app .prefPane, because that's where most other system daemons (like httpd, aka Apache) are launched and quit.
--
Cheers,
M. Uli Kusterer
------------------------------------------------------------
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de
_______________________________________________
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
References: 
 >How to remove the quit menu item of the Doc menu of an application? (From: "Sherman He" <email@hidden>)

  • Prev by Date: Re: Obj-C NSRect methods help
  • Next by Date: Re: Help please - Service windows won't become 'key'
  • Previous by thread: Re: How to remove the quit menu item of the Doc menu of an application?
  • Next by thread: [Newbie] Drag'n drop on doc icon?
  • Index(es):
    • Date
    • Thread