找出窗口是否可调整大小 [英] Finding out if a Window is Resizable
问题描述
有没有办法来确定活动窗口(不是我的过程,但不同的应用程序)是可调整大小?
Is there a way to determine whether the active window (not of my process, but a different application) is resizable?
编辑:我宁愿在没有applescript的情况下这样做,因为它依赖于可编写脚本的应用程序。
I would prefer to do this without applescript as it then depends on the application being scriptable.
推荐答案
使用辅助功能。一旦找到要检查的窗口,测试它是否具有 kAXGrowAreaAttribute
属性(其值将是增长区域本身,也称为大小框或[ Windows术语]调整大小句柄)。有一个窗口可以调整大小;
Use Accessibility. Once you find the window you want to examine, test whether it has the kAXGrowAreaAttribute
attribute (the value for which would be the grow area itself, a.k.a. the "size box" or [the Windows term] "resize handle"). A window that has one is resizable; a window that doesn't have one is not resizable.
用户需要有辅助设备的访问权限,但这样做比脚本化不可编写的应用程序更容易
The user will need to have access for assistive devices turned on, but making that happen is easier than scripting unscriptable applications.
从2011年起修改:狮子会杀死大小框,因此现在您需要测试窗口的大小属性是否可以更改。
Edit from the year 2011: Lion killed off size boxes, so now you'll need to test whether the window's size attribute can be changed.
这篇关于找出窗口是否可调整大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!