Psychtoolbox>Screen.{mex*} subfunction

rect=Screen(‘GlobalRect’, windowPointerOrScreenNumber);

Get global rect of window or screen. This is the real position / rectangular
area occupied by a screen or onscreen window, with respect to the origin (0,0)
of the desktop coordinate system. A secondary display screen will have its
top-left corner not at (0,0), but at a proper offset, depending if mirror mode
is on or off, and how your displays are arranged in the display settings dialog.
An onscreen window which is not displayed in fullscreen mode will have its
top-left and bottom-right corners properly set.

###See also: