Re: How to remove the quit menu item of the Doc menu of an application?
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