Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get a list of all open NSWindow from all running application?

Tags:

cocoa

nswindow

Is there a way to get list of open or visible NSWindow from mac desktop?

like image 556
Teo Choong Ping Avatar asked Oct 27 '10 18:10

Teo Choong Ping


1 Answers

Note that not all windows are necessarily NSWindows, and that NSWindow only provides an interface to windows in your own address space.

The supported way to access every window is the CGWindow API. Take a look at the Son of Grab sample code to see how it's done.

like image 172
Chuck Avatar answered Feb 05 '23 12:02

Chuck