开发者

NSTask with no dock icon for child processes

开发者 https://www.devze.com 2023-01-31 11:57 出处:网络
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 l

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 co开发者_Python百科de 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!

0

精彩评论

暂无评论...
验证码 换一张
取 消