Getting Window Number through OSX Accessibility API

前端 未结 2 687
南方客
南方客 2020-12-07 22:55

I am working on an application that moves windows of third party applications around on the screen.

To get an overview of all currently open windows, I use



        
2条回答
  •  失恋的感觉
    2020-12-07 23:40

    There is a private function for obtaining CG window number for a given AX object for window: _AXUIElementGetWindow . More details in SO discussion Uniquely identify active window on OS X It looks like there is no public API to do the task with 100% probability. Identifying windows by title and frame (as described in answer above) will works in 99.9% of cases.

提交回复
热议问题