Is it Possible to Identify the *Second* Window in a Desktop/Space When it is in a Different Application from the frontmost App?

I have heard (but not used it) that from the introduction of Spaces (OSX 10.3??) through OSX 10.9 there was a public API that gave that information. However it was deprecated and not replaced by anything. IOW, Apple now keeps that to themselves with Private APIs. This may not be entirely accurate, it's what I remember reading and I don't remember the source(s), probable people pontificating in comments on Ask Different or Stack Overflow.

If you can find a way to access that info, it would be useful for so much more than my original question in this thread.