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

shoumikhin picture shoumikhin · Jun 14, 2010 · Viewed 7.5k times · Source

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

Answer

Scott Giese picture Scott Giese · Jun 15, 2010

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.