开发者

Monitoring Apples "System Events" with Cocoa

I was wondering if there was a way to write a Cocoa app that listened for OS system events such as an application launching, a window switches, etc, 开发者_JAVA百科etc. My thought was to watch [NSNotficationCenter default] for messages but so far I haven't been able to find much. Does anyone have any suggestions?

Thanks!


Some messages that might interest you would be provided to [NSWorkspace notificationCenter], such as when apps launch, come to the front, or quit.

I'm not sure what you mean by "window switches". If you mean changing which window is in front without changing which app is in front, that's generally considered "none of your business" on the Mac.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜