other application window close event

谁都会走 提交于 2020-01-14 13:46:27

问题


How to detect other applications window close event or notification in cocoa/carbon based application?

eg. if there are multiple windows in TextEdit application how to detect close event on particular window rather than whole application itself.


回答1:


How to detect other applications window close event or notification in cocoa/carbon based application?

The way to do that sort of thing is to use MacOS X's accessibility model. There's a good example in the documentation that'll give you an idea of the kinds of things you can do with accessibility -- getting notified of windows being opened or closed is certainly among its capabilities.

And by the way: it works with both Cocoa and Carbon apps.



来源:https://stackoverflow.com/questions/12422327/other-application-window-close-event

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!