View and search windows on OS X

I am trying to do some things on OS X using a carbon api, but I cannot find anything that I was looking for on Google or the Apple development website.

Ideally, I would like to find a function that finds a window in a specific place on the screen. It seems that there are similar functions, but one of them says that it only finds windows in the current process, and the other says that it is designed to determine the destination of the mouse clicks.

Assuming there is no way to do this, as I will continue to repeat all the windows on the screen. Finding information about how the OS X window manager works is quite difficult because it does not have a name, and any search on Google is overloaded with a link to the Windows operating system. Are there any nested windows? What is a window list? Is there only one? does each process have one? can you arbitrarily create many of them? I presumably guess that GetWindowList is what I'm looking for, but there is no example, and the documentation is all vague "Get the next window," without explaining the abstraction or example code.

If someone can explain how I can do this, or how the window manager sees things or tells me somewhere that I could read about it, that would be great!

+3
source share
1 answer

I think you're looking for Quartz Window Services , which is part of the Core Graphics framework. You probably want to start with the CGWindowListCreate () function to get a list of ID numbers for the windows on the screen, which you can then use to get more information about each individual window.

+4
source

Source: https://habr.com/ru/post/1713613/


All Articles