Function

CGWindowListCreateDescriptionFromArray

Generates and returns information about windows with the specified window IDs.

Declaration

CFArrayRef CGWindowListCreateDescriptionFromArray(CFArrayRef windowArray);

Parameters

windowArray

An array of CGWindowID types, each of which corresponds to a window whose information you want to retrieve.

Return Value

An array of CFDictionaryRef types, each of which contains information about one of the windows in the current user session. If there are no windows matching the desired criteria, the function returns an empty array. If you call this function from outside of a GUI security session or when no window server is running, this function returns NULL.

Discussion

This function ignores any window IDs in the windowArray parameter that refer to windows that no longer exist. (This can occur if the user closes a window between the time you retrieve its ID and the time you call this function.) You should therefore not assume that the returned array of dictionaries contains the same number of entries as this parameter. To make it easier to associate window IDs with the correct information, however, each dictionary does contain a kCGWindowNumber key whose value is the corresponding window ID. For the list of keys and values that may be present in the dictionary, see Required Window List Keys and Optional Window List Keys.

See Also

Getting Window Information

CGWindowListCopyWindowInfo

Generates and returns information about the selected windows in the current user session.

CGWindowListCreate

Returns the list of window IDs associated with the specified windows in the current user session.

CGWindowListCreateImage

Returns a composite image based on a dynamically generated list of windows.

CGWindowListCreateImageFromArray

Returns a composite image of the specified windows.