Mac OS X - an application without a menu?

I would like to create an application that does not have a menu, a dock icon or is in the application switcher. Basically, it should be like Quicksilver: I would activate it through a global hotkey, say from Safari, and a small window would appear, but Safari does not become inactive, and another menu does not appear. I hope you understand what I mean ...

How can I do it? I can prevent the dock icon, application switch, but I do not know how I can prevent other applications from becoming inactive when the application window appears or how I can remove the menu.

Thanks for any tips!

+6
source share
2 answers

Try to find " LSUIElement ". This should give you all the information you need.

(In particular, this page is in the documentation ).

+6
source

As Dave already said, add

 LSUIElement YES 

in your application Info.plist file. This will save you from the icon and menu bar.

Then, to actually bring the window to the forefront at the appropriate time (for example, when launched through the global keyboard shortcut), you can do something like this:

 ProcessSerialNumber psn = {0, kCurrentProcess}; SetFrontProcess(&psn); [someWindow makeKeyAndOrderFront:nil]; 
+5
source

Source: https://habr.com/ru/post/888776/


All Articles