Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Need to find which window is active



On Oct 31, 2003, at 9:20 PM, Eric Schlegel wrote:
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

Is it possible to use any of these APIs (or any APIs for that matter) to obtain the name of the window once I'm notified that it's become active?
thanks!
Bill
_______________________________________________
carbon-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/carbon-development
Do not post admin requests to the list. They will be ignored.


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.