Click here to Skip to main content
15,911,531 members
Home / Discussions / Article Writing
   

Article Writing

 
Generalnews: protocol Pin
Sasa Kajic7-Dec-00 0:48
Sasa Kajic7-Dec-00 0:48 
GeneralRe: news: protocol Pin
Bjornar Henden7-Dec-00 1:32
Bjornar Henden7-Dec-00 1:32 
GeneralRe: news: protocol Pin
SAWilde7-Dec-00 22:46
SAWilde7-Dec-00 22:46 
GeneralRe: news: protocol Pin
Sasa Kajic8-Dec-00 2:59
Sasa Kajic8-Dec-00 2:59 
Generalnews: protocol Pin
Sasa Kajic7-Dec-00 0:47
Sasa Kajic7-Dec-00 0:47 
GeneralSending msg to Pager thru ASP Pin
6-Dec-00 4:26
suss6-Dec-00 4:26 
GeneralRe: Sending msg to Pager thru ASP Pin
SAWilde7-Dec-00 22:53
SAWilde7-Dec-00 22:53 
GeneralClipping Region of Child Window Controls Pin
Brian Rosenthal29-Nov-00 9:48
Brian Rosenthal29-Nov-00 9:48 
I cannot figure out how to persistently change the clipping region of a child window control.

I have a rich edit control (non-mfc... created with CreateWindowEx), and I want to change the visible area of the control dynamically. There seem to be three approaches, and I cannot seem to figure out how to get any of them to work:

1. Call SetWindowRgn() on the child window control: this weirdly enough seems to make the specified region invisible, rather than visible, and is not persistent (the next InvalidateRect call re-draws the region.

2. Call SelectClipRgn(): this isn't persistent after the display context is released. The following code for example completely ignores my call to SelectClipRgn():

hdc = GetDC(hwnd);
rgn1 = CreateRectRgn(0, 0, 50, 50);
(void)SelectClipRgn(hdc, rgn1);
(void)ReleaseDC(hwnd, hdc);
hdc = GetDC(hwnd);
(void)GetClipBox(hdc, &WinRect);
rgn1 = CreateRectRgnIndirect((const RECT *)(&WinRect));
hbr = (HBRUSH) GetStockObject(WHITE_BRUSH);
(void)FillRgn(hdc, rgn1, hbr);
...

3. Intercept the WM_PAINT message of the control, and change the clipping region before the control is painted. The problem here is that I don't know how to intercept the child window WM_PAINT message without completely re-writing the control, and that doesn't seem to be the right solution.

Anyway, I love your site... first time I've logged onto CodeProject.com. I would appreciate any insight into how to clip a child control (a rich edit control in particular), but I have some buttons that I also want to clip in the same region.

Thank you,
Brian

Brian Rosenthal
Chief Technology Officer
MyBestHealth, Inc.
brosenthal@mybesthealth.com
GeneralRe: Clipping Region of Child Window Controls Pin
Brian Rosenthal2-Dec-00 18:09
Brian Rosenthal2-Dec-00 18:09 
GeneralRe: Clipping Region of Child Window Controls Pin
Brian Rosenthal2-Dec-00 18:09
Brian Rosenthal2-Dec-00 18:09 
GeneralI think I understand wierd case 'A' Pin
Jim Howard5-Dec-00 6:48
Jim Howard5-Dec-00 6:48 
GeneralRe: I think I understand wierd case 'A' Pin
SAWilde7-Dec-00 22:41
SAWilde7-Dec-00 22:41 
GeneralDisplay selection in Button Controls Pin
Amit Dey27-Nov-00 10:31
Amit Dey27-Nov-00 10:31 
GeneralRe: Display selection in Button Controls Pin
Michael Dunn27-Nov-00 15:19
sitebuilderMichael Dunn27-Nov-00 15:19 
GeneralCode lines in VisualC(or VB) that add a new menu in Excell's menu bar Pin
26-Nov-00 22:58
suss26-Nov-00 22:58 
GeneralCustomizing MS Internet Explorer Pin
J.Sridhar24-Nov-00 19:55
J.Sridhar24-Nov-00 19:55 
GeneralRe: Customizing MS Internet Explorer Pin
ColinDavies24-Nov-00 20:55
ColinDavies24-Nov-00 20:55 
GeneralRe: Customizing MS Internet Explorer Pin
29-Nov-00 8:59
suss29-Nov-00 8:59 
GeneralLaunch a file when download is complete Pin
22-Nov-00 4:32
suss22-Nov-00 4:32 
GeneralC/C++ and JavaScript interaction Pin
21-Nov-00 20:05
suss21-Nov-00 20:05 
GeneralMicrosoft Project File Format MPX Pin
Andrew Postlewhite21-Nov-00 0:06
Andrew Postlewhite21-Nov-00 0:06 
GeneralSoftware Protection Pin
Dominic I. Holmes20-Nov-00 8:09
Dominic I. Holmes20-Nov-00 8:09 
GeneralRe: Software Protection Pin
J.Sridhar24-Nov-00 20:01
J.Sridhar24-Nov-00 20:01 
GeneralRe: Software Protection Pin
Masoud Samimi2-Dec-00 0:05
Masoud Samimi2-Dec-00 0:05 
GeneralFully owner draw interface Pin
14-Nov-00 4:28
suss14-Nov-00 4:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.