How to reparent a Cocoa window?

后端 未结 3 1504
余生分开走
余生分开走 2021-01-15 03:30

I need to host my window upon a window of another application. How to enumerate windows of another Cocoa application? Is it possible to control them? If no: how can I draw

3条回答
  •  旧时难觅i
    2021-01-15 04:07

    Cocoa does not support reparenting of another application window, or drawing on it.

    But, there're two ways to get windows attributes for all the applications, like position, size, z-order, etc.

    1. Accessibility API (also allows to control a foreign application window: move, resize, press buttons on it, etc.). If a foreign application does not support Accessibility API, then...
    2. Quartz Window Services and a sample code for them, called "Son of Grab".

提交回复
热议问题