lsuielement

Transform LSUIElement to foreground application

不问归期 提交于 2020-01-05 19:12:33
问题 I have an app which must run all the time (if the user agree whit this). When the user quit the app, I transform the foreground app into a LSUIElement (the app only has a menu bar icon, the dock icon and the menu disappear). I have an options in the menu item which works ok and transform the LSUIElement into a foreground app (I use the functions [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular] and [NSApp activateIgnoringOtherApps:YES] ). My problem appear when the user double

Transform LSUIElement to foreground application

て烟熏妆下的殇ゞ 提交于 2020-01-05 19:12:11
问题 I have an app which must run all the time (if the user agree whit this). When the user quit the app, I transform the foreground app into a LSUIElement (the app only has a menu bar icon, the dock icon and the menu disappear). I have an options in the menu item which works ok and transform the LSUIElement into a foreground app (I use the functions [NSApp setActivationPolicy:NSApplicationActivationPolicyRegular] and [NSApp activateIgnoringOtherApps:YES] ). My problem appear when the user double

How to hide the Dock icon

走远了吗. 提交于 2019-12-17 04:12:14
问题 I want to make a preference for hiding the Dock icon and showing an NSStatusItem . I can create the StatusItem but I don't know how to remove the icon from Dock. :-/ Any ideas? 回答1: I think you are looking for the LSUIElement in the Info.plist LSUIElement (String). If this key is set to “1”, Launch Services runs the application as an agent application. Agent applications do not appear in the Dock or in the Force Quit window. Although they typically run as background applications, they can

How to hide the Dock icon

老子叫甜甜 提交于 2019-12-17 04:12:08
问题 I want to make a preference for hiding the Dock icon and showing an NSStatusItem . I can create the StatusItem but I don't know how to remove the icon from Dock. :-/ Any ideas? 回答1: I think you are looking for the LSUIElement in the Info.plist LSUIElement (String). If this key is set to “1”, Launch Services runs the application as an agent application. Agent applications do not appear in the Dock or in the Force Quit window. Although they typically run as background applications, they can

LSUIElement not working

筅森魡賤 提交于 2019-11-28 09:23:47
I have an application that has LSUIElement = 1 in the Info.plist. When I run the application, a dock item and toplevel menu bar is created for it. Why? EDIT: I was using a library that was calling TransformProcessType(), clobbering my Info.plist configuration. Go to your Info.plist file, and add a new key-value pair, or type Boolean. Start typing in the key the phrase "Application is agent". It should auto-complete for you. Then check the checkbox. This is how I create my agent applications, and it works every time! drawnonward The 1 must be a string, not a number (according to the

LSUIElement not working

╄→尐↘猪︶ㄣ 提交于 2019-11-27 02:52:50
问题 I have an application that has LSUIElement = 1 in the Info.plist. When I run the application, a dock item and toplevel menu bar is created for it. Why? EDIT: I was using a library that was calling TransformProcessType(), clobbering my Info.plist configuration. 回答1: Go to your Info.plist file, and add a new key-value pair, or type Boolean. Start typing in the key the phrase "Application is agent". It should auto-complete for you. Then check the checkbox. This is how I create my agent

How to hide the Dock icon

左心房为你撑大大i 提交于 2019-11-26 18:07:28
I want to make a preference for hiding the Dock icon and showing an NSStatusItem . I can create the StatusItem but I don't know how to remove the icon from Dock. :-/ Any ideas? I think you are looking for the LSUIElement in the Info.plist LSUIElement (String). If this key is set to “1”, Launch Services runs the application as an agent application. Agent applications do not appear in the Dock or in the Force Quit window. Although they typically run as background applications, they can come to the foreground to present a user interface if desired. See a short discussion here about turning it on