How to get another application window's title, position and size in Mac OS without Accessibility API?

后端 未结 2 1716
自闭症患者
自闭症患者 2020-12-05 06:03

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.a

2条回答
  •  难免孤独
    2020-12-05 06:45

    You can use CGWindowListCreateDescriptionFromArray(). See CGWindow.h

    This gives you an array of dictionaries. The following information will probably be useful to you:

    • position and size: kCGWindowBounds
    • name: kCGWindowName

提交回复
热议问题