Hi, how can I tell if a window is in the foreground (on top) but not the active window? It wouldn't be covered by any other windows but it doesn't take up the entire screen so another window could be the active one. I just need to know if it can be seen.

Thanks for any help.