Re: Screenshot of another app's Window
Re: Screenshot of another app's Window
- Subject: Re: Screenshot of another app's Window
- From: Mike Paquette <email@hidden>
- Date: Fri, 26 Oct 2007 17:56:40 -0700
On Jun 29, 2007, at 11:08 AM, Mitchell Hashimoto wrote:
Hi,
I'm trying to get a screenshot of another app's window, if that's
possible, from within my cocoa app. So this is somewhat of a multipart
question:
1.) How can I get a list of open windows and check to see if the
window I am looking for is there?
2.) How do I make sure this window is frontmost? How do I make it
frontmost?
3.) What functions must I use to take a screenshot of a specific rect?
Thank you very much, I've been searching around on google and it
hasn't been bringing much up.
Mitchell Hashimoto
Starting in Mac OS X 10.5 On Mac OS X 10.5 you can read back
information on other windows within the same GUI session as the
calling process using the CGWindow API (defined in /System/Library/
Frameworks/ApplicationServices.framework/Frameworks/
CoreGraphics.framework/Headers/CGWindow.h).
Windows which have been marked as shared (kCGWindowSharingReadOnly,
the default, or kCGWindowSharingReadWrite) can be captured as
CGImageRefs.
Images can be generated from a list of windows passed to
CGWindowListCreateImageFromArray(), or from a set of selection
conditions ("All windows below this window") passed to
CGWindowListCreateImage(). Various options control the bounds and
content of the resulting image.
Refer to the comments in the header file for information on using
these new APIs.
Mike Paquette
CoreGraphics Team
_______________________________________________
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