dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: visible region of control

  1. #1
    Join Date
    Jan 2005
    Location
    Akron, Ohio
    Posts
    669

    visible region of control

    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!
    error C2146a : syntax error : nebulizer stained in the tower floppy apple rider. Go rubble in flee smite. Bleeble snip snip.

    Documentation says: error C2146a - This means there is an error somewhere in the course of human endeavor. Fix in the usual way.

  2. #2
    Join Date
    Jan 2005
    Location
    Akron, Ohio
    Posts
    669

    Re: visible region of control

    Hmmmm. . . Not possible?
    error C2146a : syntax error : nebulizer stained in the tower floppy apple rider. Go rubble in flee smite. Bleeble snip snip.

    Documentation says: error C2146a - This means there is an error somewhere in the course of human endeavor. Fix in the usual way.

  3. #3
    Join Date
    Aug 2000
    Location
    New York, NY, USA
    Posts
    5,656

    Re: visible region of control

    Vlad - MS MVP [2007 - 2012] - www.FeinSoftware.com
    Convenience and productivity tools for Microsoft Visual Studio:
    FeinWindows - replacement windows manager for Visual Studio, and more...

  4. #4
    Join Date
    Jan 2005
    Location
    Akron, Ohio
    Posts
    669

    Re: visible region of control

    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.
    error C2146a : syntax error : nebulizer stained in the tower floppy apple rider. Go rubble in flee smite. Bleeble snip snip.

    Documentation says: error C2146a - This means there is an error somewhere in the course of human endeavor. Fix in the usual way.

  5. #5
    Join Date
    Nov 2007
    Posts
    613

    Re: visible region of control

    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.

  6. #6
    Join Date
    Apr 2000
    Location
    Belgium (Europe)
    Posts
    4,626

    Re: visible region of control

    Quote Originally Posted by paradoxresolved View Post
    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.
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)