menubar app with dock icon?

If I set NSUIElement in the application plist, it removes both the Apple menu and dock icon. Is there a way to just remove the apple menu and still have the dock icon? I have the MBS plugins so suggestions there are welcome.



Why do you need the Dock Icon? You can place badges or create progress info of the StatusBar icon.

Why do you need to hide the icons ?

A Statusbar app does not have a Dock Icon. Look at apps like DropBox, CreativeCloud, iCloud, BlueTooth, Wifi, and Date apps. You control them from the status bar, not a dock icon.

Its just a personal project of mine so I’m not worried if its the acceptable thing to do. I wanted to be able to access the menu either from the status bar or the dock icon. I have a large monitor (34") and didn’t want to have to drag my mouse clear across the screen all the time to get to it.

Yes, I know I can just not set the plist value and have the dock icon with the status bar but I was curious if there was a way to eliminate the apple menu.

It seems that Apple is preventing that from happening. Every command in Cocoa (setMenuBarVisible) or Carbon (SetSystemUIMode) which hides the menubar also hides the Dock.

Documentation also states that “If you specify NSApplicationPresentationHideMenuBar, it must be accompanied by NSApplicationPresentationHideDock.” (in NSApplicationPresentationOptions)

FYI, this is what I used in Xojo to hide the menubar:

declare function NSClassFromString lib “Cocoa” (name as CFStringRef) as Ptr
declare sub setMenuBarVisible lib “Cocoa” selector “setMenuBarVisible:” (cls as Ptr, state as Boolean)
setMenuBarVisible NSClassFromString( “NSMenu” ), false //Make it invisible

You can also use SetSystemUIMode in Carbon

declare function SetSystemUIMode lib “Carbon” (mode as integer, options as integer) as int64
call SetSystemUIMode( nnnn, 0 )

nnnn values are composed of:

typedef enum NSApplicationPresentationOptions : NSUInteger {
NSApplicationPresentationDefault = 0,
NSApplicationPresentationAutoHideDock = (1 << 0),
NSApplicationPresentationHideDock = (1 << 1),
NSApplicationPresentationAutoHideMenuBar = (1 << 2),
NSApplicationPresentationHideMenuBar = (1 << 3),
NSApplicationPresentationDisableAppleMenu = (1 << 4),
NSApplicationPresentationDisableProcessSwitching = (1 << 5),
NSApplicationPresentationDisableForceQuit = (1 << 6),
NSApplicationPresentationDisableSessionTermination = (1 << 7),
NSApplicationPresentationDisableHideApplication = (1 << 8),
NSApplicationPresentationDisableMenuBarTransparency = (1 << 9),
NSApplicationPresentationFullScreen = (1 << 10),
NSApplicationPresentationAutoHideToolbar = (1 << 11),
NSApplicationPresentationDisableCursorLocationAssistance = (1 << 12)
} NSApplicationPresentationOptions;