所有空间中所有有效打开窗口的 OSX 列表?
我想知道是否有一种方法可以可靠地检索所有空间中所有打开的有效窗口?
我现在遇到的问题是,在像 Microsoft Word for Mac 这样的程序上有很多子窗口,导致我的列表被没有标题的空白窗口或不通向任何地方的窗口弄乱。例如,对于 Word,当我只打开 1 个文档时,我会看到以下 3 个窗口:
- 文档 1
- Microsoft Word
- 桌面
全部都来自 Microsoft Word,Excel 和 Powerpoint 也是如此,该问题似乎是 Microsoft Office 独有的套房。关于如何处理实际上没有任何东西的窗口有什么想法吗?
I'm wondering if there's a way to reliably retrieve all open VALID windows in all spaces?
The problem I'm encountering now is that on programs like Microsoft Word for Mac there are lots of child windows, resulting in my list being muddied by blank windows with no title, or windows that just don't lead anywhere. For example, for Word I'm getting these 3 windows when I only have 1 document open:
- Document 1
- Microsoft Word
- Desktop
All are from Microsoft Word, and same goes for Excel and Powerpoint, the problem seems to be pretty exclusive to the Microsoft Office suite. Any ideas on how to deal with windows that don't actually have anything?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试与辅助功能相关联(您没有提及现在如何获取窗口列表),或者只是使用一些启发式方法(忽略没有标题、没有工作区编号的窗口,查看窗口标签位等。 )。拉出Quartz Debug 中的窗口列表,浏览一下,你会看到一些差异。如果窗口可见,您还可以在后台按住 Control-Option 并使用 Quartz Debug 来获取弹出的 HUD,其中包含有关光标下方窗口的一些更详细的信息。
如果你真的很绝望,你可以抓住窗口内容,看看它们是透明的还是白色的。
You can try to correlate with Accessibility (you don't mention how you're getting the window list right now), or just use some heuristics (ignore windows with no title, no workspace number, look at the window tag bits, etc.). Pull up the window list in Quartz Debug, browse around and you'll see some differences. If the window is visible, you can also hold down Control-Option with Quartz Debug in the background to get a pop up HUD with some more detailed information about the window underneath the cursor.
If you're really desperate you could grab the window contents and see if they're all transparent or white.