其他应用程序窗口关闭事件

其他应用程序窗口关闭事件

本文介绍了其他应用程序窗口关闭事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何检测可可 /碳基应用程序中的其他应用程序 窗口关闭 事件或通知?

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.

这篇关于其他应用程序窗口关闭事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 08:42