如何在没有 Accessibility API 的情况下在 Mac OS 中获取另一个应用程序窗口的标题、位置和大小? [英] How to get another application window's title, position and size in Mac OS without Accessibility API?

查看:31
本文介绍了如何在没有 Accessibility API 的情况下在 Mac OS 中获取另一个应用程序窗口的标题、位置和大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果不支持 Accessibility API,如何获取窗口的标题、位置和大小?Accessibility Inspector 根本看不到它.比如说,它是 X11.app 中的一个 xterm 窗口(X11->Applications->Terminal).

How can I get window's title, position and size if it does not support Accessibility API? Accessibility Inspector does not see it at all. Say, it's a xterm window in X11.app (X11->Applications->Terminal).

推荐答案

您应该能够通过 CGWindow.h 头文件中公开的方法获得所有这些窗口信息.Apple 的文档位于 Quartz Window Services Reference 页面上.他们还有一个非常有用的示例应用程序,名为 Son of Grab 这应该会让你开始.

You should be able to get all of this window information through the methods exposed in the CGWindow.h header file. Apple's docs are online on the Quartz Window Services Reference page. They also have a very informative sample app called Son of Grab which should get you started.

这篇关于如何在没有 Accessibility API 的情况下在 Mac OS 中获取另一个应用程序窗口的标题、位置和大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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