关于MFC实现圆角矩形窗口

在文档的框架类中添加WM_SIZE消息响应代码:

void CMainFrame::OnSize(UINT nType, int cx, int cy)
{
CRgn m_rgn;
CRect rc;
GetWindowRect(&rc); //获得窗口矩形
rc -= rc.TopLeft();
m_rgn.CreateRoundRectRgn(rc.left, rc.top, rc.right, rc.bottom, 100, 100); //根据窗口矩形创建一个圆角矩形
SetWindowRgn

 

后面还会看下不规则窗口的实现

 

posted @ 2009-11-15 00:50  Maxice  阅读(1874)  评论(0编辑  收藏  举报