i am attempting to write a cocoa app that will be able to:
(1) find the location and size of all windows in the window server,
(2) determine the z-ordering of all such windows,
(3) using the results from (1) and (2), to position windows created by my app at an (x, y) position relative to and z ordering relative to other windows, not necessarily owned by my app.
can this be done?
so far, i have found the screen position using the CGWindow.h functions, and the NSWindow functions to set Z ordering based on window numbers. however, the NSWindow docs say that the window numbers returned by do not match those returned by the window server numbers from CGWindow.h, so i cannot combine the results from the two.
is there a workaround or a correct way to achieve this with the accesibility APIs? |