标签:blog http ar sp on log bs html ad
为了实现圆角的对话框窗口,这里主要用两个函数,
CreateRoundRectRgn,和SetWindowRgn
程序先通过GetWindowRgn函数得到窗口矩形,然后通过CreateRoundRectRgn函数创建一个圆角矩形,最后通过SetWindowRgn函数改变窗口的形状。
具体操作如下:
1
2
3
void CMyDlg::OnSize(UINT nType, int cx, int cy) { CDialog::OnSize(nType, cx, cy); // TODO: Add your message handler code here CRgn m_rgn; CRect rc; GetWindowRect(&rc); rc-=rc.TopLeft(); m_rgn.CreateRoundRectRgn(rc.left,rc.top,rc.right,rc.bottom,100,100); SetWindowRgn(m_rgn,TRUE); }
运行结果如下:
标签:blog http ar sp on log bs html ad
原文地址:http://blog.csdn.net/jiangqin115/article/details/41253215