Disabling dock icon for an app in Mac OSX in different way
Asked Answered
C

3

0

In mac osx for most of the applications keeps a dock icon. But if the developer of the same applications wants to hide the dock icon, then how do he hide it?

As a developer i know 'Info.plist' property file is one way to hide the dock icon for an application.

But dont we have any other solution for this?

I hope there should be some other ways as everybody know "there are N no of way of solutions for a problem"

Thanks in advance

M@k4mac

Cairns answered 4/3, 2011 at 12:21 Comment(3)
Why should you as the application developer be able to control the user's dock?Nab
@Cody Gray: Some applications are designed to run in the background and not display their icons in the Dock.Shading
@mipadi: Ah, I meant other than through the Info.plist, which is specifically intended to address that use case.Nab
C
2

If you're developing the app, you want to set LSUIElement to TRUE in your Info.plist.

If you're running the app, you can use a program like Dockless.

If you want superfluous options, use Linux :)

Chishima answered 22/6, 2011 at 20:2 Comment(0)
S
1

The Info.plist solution is the only way to hide the icon from the Dock (for a GUI application).

What are you trying to accomplish? Maybe there's a solution that can be worked out if you give more details.

Shading answered 4/3, 2011 at 17:17 Comment(0)
U
1

this LSUIElement method is no longer work under 10.8

add Carbon.framework make plist Application is agent (UIElement) =1 checked

// this should be called from awakeFromNib method
if (![[NSUserDefaults standardUserDefaults] boolForKey:@"LaunchAsAgentApp"]) 
{   ProcessSerialNumber psn = { 0, kCurrentProcess };

// display dock icon
TransformProcessType(&psn, kProcessTransformToForegroundApplication);

// enable menu bar
SetSystemUIMode(kUIModeNormal, 0);

// switch to Dock.app
[[NSWorkspace sharedWorkspace] launchAppWithBundleIdentifier:@"com.apple.dock"    options:NSWorkspaceLaunchDefault additionalEventParamDescriptor:nil launchIdentifier:nil];

// switch back
[[NSApplication sharedApplication] activateIgnoringOtherApps:TRUE];

}
Udale answered 15/7, 2012 at 20:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.