| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
Using the accessibility APIs, you'd do something like this:
- get the pid_t of an application
- call AXUIElementCreateApplication with that pid
- call AXObserverCreate with that pid
- call AXObserverAddNotification with that AXUIElementRef and observer, passing kAXMainWindowChangedNotification as the notification
- call AXObserverGetRunLoopSource on that observer
- call CFRunLoopAddSource( GetCFRunLoopFromEventLoop( GetMainEventLoop() ), passing that run loop source
Now your callback proc should be called when the main window (i.e., the active window) of that application changes.
-eric
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.