Determine if a rectangle is visible inside the window

I would like to determine if the rectangle inside the window is fully visible.

I found RectVisible, but this function determines if any part of the rectangle is visible, I want to know if all the rectangles are visible.

Is there any function for this?

+2
source share
4 answers

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.

, , . , , -, , .

+2

PtVisible .

PtVisible .

+2

, .

; ; ?

, , , .

+1

All the functions associated with the rectangular rectangle of the clips and the visibility of the points were violated with the new Windows Vista desktop layout feature. Functions will work well in Windows XP and earlier, as well as in Windows 7 with Aero / Desktop disabled, but otherwise they will always claim that the entire window is visible.

0
source

All Articles