Reputation: 197
I'm want to get the focused window reference in my Cocoa App and I really don't know how. I've read some articles about Accessability API and others about CGWindow but it still not Clear. I got to be able to determine the position of the current focused window, even though it's not from my application (It would be an iTunes Window or a Finder window).
Upvotes: 1
Views: 3419
Reputation: 6590
I realize this doesn't quite answer your question, but if you're willing to settle for the current application instead of the currently focused window then you should use the currentApplication
method of NSRunningApplication
. More here.
Upvotes: 0