2

I am trying to create a simple launcher application on the Mac.

I am able to set LSUIElement = 1 on the parent application, but child processes launched from the application appear in the Dock when launched.

Is there a way that I can prevent an icon for the application from showing up in the dock? This is the code I'm currently trying to use.

NSString *launchPath = [[NSBundle mainBundle] pathForResource:@"HelloWorld" ofType:@""];
NSLog(@"%@", launchPath);

NSTask *task = [[NSTask alloc] init];
[task setLaunchPath:launchPath];
[task launch];

Thanks!

jocull
  • 20,008
  • 22
  • 105
  • 149
  • What are you launching with NSTask, command line tools or apps? Normally NSTask is used for command line tools, and you don't need to do anything special to keep them from showing up in the Dock. – JWWalker Dec 19 '10 at 08:16
  • I'm trying to launch a Mono app using a command line tool I suppose. Mono's `macpack` basically packages a shell script that launches the app from within Mono. Problem is that I can't get it to hide the dock icon for a system tray only application. I'm trying to find work arounds if any exist. Related question here: http://stackoverflow.com/questions/4414629/system-tray-only-no-dock-icon-application-using-c-mono-on-mac – jocull Dec 19 '10 at 21:52

0 Answers0