I want to observe any window on OSX if it is moved. I don't own the windows so i can't get to it directly so I think I have to use the Accessibility APIs. I found a solution for the current active Application here: How can my app detect a change to another app's window? but I can't figure out how I have to modify this that it works for any window which is open. I hope anybody could give me a hint in which direction I have to look.
Asked
Active
Viewed 220 times
0
-
Does it make sense to observe window-move events on applications that aren’t currently active? How often do inactive windows move? – zoul Jun 19 '11 at 14:33
-
ok right. Is it possible to get notified if the current focused application changes? – n3on Jun 19 '11 at 14:54
1 Answers
1
As I mentioned in the comments, people usually only want to detect window-move events on focused windows. (As unfocused windows seldom move.) If you want to detect application switches, you can poke into this sample project by Apple that shows how to update iChat status with the frontmost application’s name. And as you said, there’s already a solution for an active window.