I need to determine if a Window (or a dialog, or a point) is visible
on screen.

Previously we simply tested that the four corners of each Window was
greater than 0,0 and less than the max cx/cy extents.

Today it's very popular with multi-screen configurations and this does
not work anymore since the desktop can be a configuration of many
screens where some screens can be on negative coordinates and 0,0
doesn't have to be the bottom left. Also, neither of the screens is
required to align with another.

Basically, the desktop is a polygon while the cx/cy extents simply
tell us the maximum x and y extents.

So, how can I get this polygon so that I can preform a point in
polygon test for each of the Windows four corner points?

Or, is there an easier way of testing that a window is completely on

The programming language I'm using is C/C++/MFC

Kind regards