Find which SCDisplay contains a window to pick it

Hello! I'm trying to find my own window or SCWindow in a SCDisplay. This is so I can automatically change the SCDisplay to record when I drag a window from a display to another. Is there any way to check the windows that are contained in every SCDisplay? Thank you in advance!

Find which SCDisplay contains a window to pick it
 
 
Q