问题描述
如何检测可可 /碳基应用程序中的其他应用程序 窗口关闭 事件或通知?
How to detect other applications window close event or notification in cocoa/carbon based application?
例如。如果在TextEdit应用程序中有多个窗口,如何检测特定窗口而不是整个应用程序本身的关闭事件。
eg. if there are multiple windows in TextEdit application how to detect close event on particular window rather than whole application itself.
推荐答案
做这样的事情是使用MacOS X的。有,它将给你一个想法的东西,你可以做的无障碍 - 获取通知窗口正在打开或关闭当然是其功能。
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.
顺便问一下:它适用于Cocoa和Carbon应用程序。
And by the way: it works with both Cocoa and Carbon apps.
这篇关于其他应用程序窗口关闭事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!