How might I capture the visible region of a control? In other words, suppose I have one control partially overlapping the first. I'd like to be able to capture the region that is visible in the bottom control.
Thanks!
Printable View
How might I capture the visible region of a control? In other words, suppose I have one control partially overlapping the first. I'd like to be able to capture the region that is visible in the bottom control.
Thanks!
Hmmmm. . . Not possible?
Thank you for your reply. I am aware of the CombineRgn function though. That problem I'm having is that I don't know how to get the region to begin with. I need some way to figure out which part of the client region of a dialog contains only the part of a control that is showing. I have a situation in which one control is partially covered by another, and need to design the control so that only the part that is showing lights up when the mouse hovers over that part.
_______________|***************
|************|****************
|************|****************
|************|****************
|************|****************
|************_________________
|************************|
|************************|
|************************|
____________________________
So, for example, I need to find a way to capture the lower left "L" shaped region. My first thought is that I would need to do this function at the level of the parent dialog, but I'm not sure.
Loop through all the points of your control and call WindowFromPoint for each. You'll get the handles of all the windows that overlap your control. Subsequently substract all the regions of those windows from the region of your control.
you don't need to worry about that.
Assuming y ou are using a correct DC and handling a WM_PAINT, then the DC will contain a clipping region that will make sure it's not actually painting anywhere it shouldn't. Or in the few rare cases it does, it'll paint your bit and then repaint other controls over it. because that's what's needed.
What you are asking wouldn't even properly work since your control could be entirely covered by another window that is semitransparent. Like the glass from another window's title bar covering your control, in that case you should still paint all of your control and let the "glass" do it's job as well.