GNU Emacs Lisp Reference Manual
This section describes how to relate screen coordinates to windows.
window-at returns nil.
If you omit frame, the selected frame is used.
The argument coordinates is a cons cell of this form:
(x . y)
The coordinates x and y are measured in characters, and count from the top left corner of the screen or frame.
The value of coordinates-in-window-p is non-nil if the
coordinates are inside window. The value also indicates what part
of the window the position is in, as follows:
(relx . rely)
mode-line
vertical-split
nil
The function coordinates-in-window-p does not require a frame as
argument because it always uses the frame that window is on.