First you get the clipping area of ββthe system (the visible area of ββthe window) into the area with GetRandomRgn. Read more about the "system region" here . Then shift this area, since it is in screen coordinates (there is an example in the article I referred to). After that, create a region from your rectangle with CreateRectRgnand combine parts of your rectangle region with those that are not part of the 'system region': this is a call to CombineRgntransfer the region of the rectangle as the first region, and the system region - the second, and RGN_DIFFhow fnCombineMode. If the result is NULLREGION, your rectangle will be completely visible - it is not completely or partially closed by any window (top level or not), or not completely or partially off the screen.
, , . , , -, , .