Function: window-top-line

Return top line of window WINDOW.
This is the distance, in lines, between the top of WINDOW and the top
of the frame's window area. For instance, the return value is 0 if
there is no window above WINDOW.

WINDOW must be a valid window and defaults to the selected one.
(fn &optional WINDOW)