How to programmatically make cocoa application active

后端 未结 3 1091
傲寒
傲寒 2020-12-14 08:05

I\'ve got a background process that makes a transparent window appear when a hotkey is pressed:

[window makeKeyAndOrderFront:nil];
[[content animator] setAlp         


        
3条回答
  •  渐次进展
    2020-12-14 08:43

    For 10.6 or greater

    [[NSRunningApplication currentApplication] activateWithOptions:(NSApplicationActivateAllWindows | NSApplicationActivateIgnoringOtherApps)];
    

提交回复
热议问题