# ExcludeClipRect

This topic is 4749 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

In my app, I excluded a little rectangle for my input box but now my program won't let me draw/paint over the excluded region because I called ExcludeClipRect. So my question is: What function can I use to Include back the excluded region I clipped by calling ExcludeClipRect? This link at the very bottom, uses SelectClipRgn to remove the clipped area but I don't know how to implement it since it requires an HRGN; a handle to a region. The problem with this is that, my excluded region is stored in a RECT structure. How would I pass my RECT's coordinates to an HRGN handle or get a HRGN handle to my RECT structure which has the excluded region? How I'm using ExcludeClipRegion:

ExcludeClipRect((HDC)wParam, (fillRect.right >> 1) - (iBoxWidth >> 1),(fillRect.bottom >> 1) - (cyChar >> 1),
(fillRect.right >> 1) + (iBoxWidth >> 1),
(fillRect.bottom >> 1) + (cyChar >> 1));
// XXX.XX >> 1 is simply dividing by 2


I've tried MSDN, google and nothing gives. edit: I'm using C with the Win32 API.

##### Share on other sites
You can use CreateRectRgnIndirect() to get an HRGN from a RECT.

• 10
• 17
• 9
• 14
• 41
• ### Forum Statistics

• Total Topics
631070
• Total Posts
2997746
×