window-frame

window-frame is a built-in function in `C source code'.

(window-frame &optional WINDOW)

Return the frame that window WINDOW is on.
WINDOW must be a valid window and defaults to the selected one.