1

I need to find the coordinates of windows open even when they are not launched by my application, and after some searching I came across quartz window services. However, the reference document I linked to does not mention where this is located, and it was the only document I could find about it. I have looked through other frameworks reference documents, but none of them so much as mention it.

The problem obviously arrises solely out of my own ignorance, and I did not really want to ask. But, I have searched all over the internet, and have been able to find absolutely no reference to the location of quartz windows service.

Where is it? Is it part of a framework, and if so what class is it in? All I know is what functions it contains, and that they look like exactly what I need!

Thank you in advance for any help. Also, if you know how I could figure this out for myself in the future, I would appreciate that as well.

Note: I don't know if it matters, but I am planning to use JNA to call it from Java as opposed to using it from C.

2 Answers2

2

Yeah, that's a little less than obvious. By searching for "Quartz Window Services" I was able to find the link to the overview, such as it is: https://developer.apple.com/library/mac/#documentation/Carbon/Reference/CGWindow_Reference/Reference/Introduction.html

That shows that it's in the ApplicationServices framework.

Ken Thomases
  • 88,520
  • 7
  • 116
  • 154
1

Well first off, I'm not 100% certain how you're going to access C methods from Java (I've never done it myself), but if it's possible to do the bridging, you can use the Accessibility API in order to get the windows for all of the running applications (see the answer to this related question). Once you have that list of windows, you can get the frame (coordinates) of where each of those windows lives on-screen.

Another thing about using the Accessibility API, the user has to "OPT IN" to allowing it. It's not normally turned on by default.

Here's another question that closely matches yours, but the accepted answer only provides a solution to retrieve the windows for your own (currently running) application.

Community
  • 1
  • 1
Michael Dautermann
  • 88,797
  • 17
  • 166
  • 215