Aladdin
Aladdin

Reputation: 171

Is it possible to attach my window to a window of another application?

On Windows we can find the window handle of running process and attach our window onto it as a child window, so the two different processes look like the same one.

I wonder if there is a similar way to implement this requirement in cocoa.

Upvotes: 3

Views: 730

Answers (1)

Parag Bafna
Parag Bafna

Reputation: 22930

This is possible using code injection. Have a look at mach inject framework and PorcShark Finder.

enter image description here

Or
Find position of another window using CGWindow methods and display your window over it.
Have a look at Son of Grab sample project.

Son of Grab shows how to use the new CGWindow API to get images of arbitrary sets of windows, including images of the current contents of the screen.

Upvotes: 2

Related Questions