Mac OS X - app without menu?

后端 未结 2 500
名媛妹妹
名媛妹妹 2021-02-06 07:38

I\'d like to build an app that does not have a menubar, a dock icon, or sits in the app switcher. Basically, it should be like Quicksilver: I\'d active it through a global hot k

2条回答
  •  一生所求
    2021-02-06 08:21

    As Dave already said, add

    LSUIElement  YES
    

    in your application's Info.plist file. That will get rid of icon and menu bar.

    Then, to actually bring a window to the front at the appropriate time (e.g. when triggered through a global keyboard shortcut), you could do something like this:

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

提交回复
热议问题