문제

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, 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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top