Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Metalmorphed

macrumors member
Original poster
Mar 14, 2010
87
0
Hi,

I got the list of windows with:
Code:
CFArrayRef m_WindowList;
	m_WindowList = CGWindowListCopyWindowInfo(kCGWindowListOptionOnScreenOnly | kCGWindowListExcludeDesktopElements, kCGNullWindowID);

Now I have an array of CGRects pointer:
Code:
CGRect* m_WindowRectList;

Now my question is, how do I get only the window position and dimentions into the CGRect array from the m_WindowList ?

Any help here ?

Thanks !
-Pablo
 
Each element in the array is a dictionary. There should be in the dictionary an object for the key kCGWindowBounds. Then you can use CGRectMakeWithDictionaryRepresentation() to turn it into a CGRect.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.