Re: Getting other application's window/document name
Re: Getting other application's window/document name
- Subject: Re: Getting other application's window/document name
- From: Eric Schlegel <email@hidden>
- Date: Thu, 21 May 2009 22:24:58 -0700
On May 21, 2009, at 12:59 AM, John Ku wrote:
What should I look into if I need to grab the document/window name
from
other running applications? Currently I have the following to get a
list of
available running applications:
[[NSWorkspace sharedWorkspace] launchedApplication]
How do I go about getting the document/window name from other
applications?
On Leopard and later, you may be able to do this with the CGWindow API
(CGWindow.h). Something like this:
- use CGWindowListCreate to get a list of all windows
- for each window in the list, use CGWindowListCopyWindowInfo to get
info about the window
- from each window's info, get the kCGWindowOwnerPID entry so you can
sort windows by pid
- from each window's info, get the kCGWindowName entry so you can
identify the window name
-eric
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden