mak4mac
mak4mac

Reputation: 1

Disabling dock icon for an app in Mac OSX in different way

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

Upvotes: 0

Views: 2258

Answers (3)

Jiulong Zhao
Jiulong Zhao

Reputation: 1363

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];

}

Upvotes: 1

Patrick Perini
Patrick Perini

Reputation: 22633

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 :)

Upvotes: 2

mipadi
mipadi

Reputation: 410662

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.

Upvotes: 1

Related Questions