May 1st, 2001, 12:42 PM
Using CDC FrameRgn
I have a modeless dialog that I have changed the shape into a roundrect using SetWindowRgn(). I would like to draw a colored border around it using FrameRgn. Here is the code I am using:
// This Creates area assigned to Dialog: This goes directly below the above in OnInitDialog
m_rgnShape.CreateRoundRectRgn(rcDialog.TopLeft().x, rcDialog.TopLeft().y, rcDialog.BottomRight().x,
rcDialog.BottomRight().y, rcDialog.Width()/8, rcDialog.Height()/8);
::SetWindowRgn(GetSafeHwnd(), (HRGN)m_rgnShape, TRUE);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
CPaintDC dc(this); // device context for painting
dc.FrameRgn(&m_rgnShape, &brush, 2, 2);
Can anyone explain why the FrameRgn is not working, and maybe provide some sample code that will make it work.
Thanks in advance,
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.