获取打开的窗户可可的列表 [英] Get a list of opened windows cocoa

查看:93
本文介绍了获取打开的窗户可可的列表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Cocoa新手,我想知道如何获得所有打开的窗口的列表。我不是在谈论运行程序,因为这将是一个容易的任务。我想列出窗口,例如,如果我有预览运行与10 pdf打开,我的程序应该能够检索所有这些pdf的列表。
我还想知道是否有一些API可以与已经打开的窗口进行交互(并且可以从外部应用程序移动它们或做其他事情)。
谢谢。

I'm new to Cocoa and I want to know how I can get a list of all open windows. I'm not talking about running programs, since this would be an easy task. I want to list windows, for example, if I have Preview running with 10 pdf opened, my program should be able to retrieve a list with all those pdf. I also want to know if there's some API available to interact with already open windows (and maybe move them or do something else) from an external application. Thank you.

推荐答案

首先,Cocoa不是首字母缩略词,所以不是COCOA。 : - )

First, Cocoa is not an acronym, so it's not "COCOA". :-)

其次,您唯一的(公共API)选项是辅助功能API。您必须在系统偏好设置的辅助功能面板中启用辅助设备的访问。

Second, your only (public API) option is the Accessibility API. You'll have to enable access for assistive devices in the Accessibility panel in Systems Preferences.

查看文档以开始: Accessibilty概述

这篇关于获取打开的窗户可可的列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆