FindWindow
FindWindow Find window & region of a point
#include <Windows.h> Window Manager
short FindWindow(thePoint, whichWin );
Point thePoint ; point, in global screen coordinates
WindowPtr * whichWin ; receives pointer to window
returns code indicating window part (inDesk, inContent, ...)
Use FindWindow to learn the location of the mouse after a mouseDown event.
It obtains a pointer to the window containing a specified point and returns a
value indicating the part of that window in which the point resides.
thePoint is a Point, in global screen coordinates. Typically, this is the point
obtained from the where member of the EventRecord after receiving
a mouse-down event.
whichWin is a pointer to a WindowPtr. Upon return, this variable will
contain the WindowPtr of the window in which the point resides. If
thePoint is in the desktop or menu bar (e.g., outside of all
windows), this variable gets set to NIL.
Returns: a short indication the window's region in which thePoint resides. It
may be one of the following:
inDesk (0) in the desktop (screen background)
inMenuBar (1) in menu bar at top of screen
inSysWindow (2) in a system window
inContent (3) in the content region of an application window
inDrag (4) in the drag region
inGrow (5) in the size region of an application window
inGoAway (6) in the close region of an application window
inZoomIn (7) in zoom region of zoomed-out application window
inZoomOut (8) in zoom region of zoomed-in application window

Notes: If the return value is inDesk or inMenuBar, whichWin will always be set
to NIL upon return.
If thePoint is in an inactive window, FindWindow returns inDrag for
points within the close, zoom, or title bar. For points within the size
region, it returns inContent.
The function will not return inGrow for windows with no size region,
inGoAway for windows with no close region, nor inZoomIn or inZoomOut
for windows with no zoom region.