原文轉自 http://blog.csdn.net/cracent/article/details/48274469
BOOL CLoginDlg::OnInitDialog()
{
CDialog::OnInitDialog();
SetWindowLong(m_hWnd, GWL_HWNDPARENT, NULL);
CRgnm_rgn;
RECT rc;
GetWindowRect(&rc); //有邊框對話框 //GetClientRect(&rc);//無邊框對話框 m_rgn.CreateRoundRectRgn(rc.left, rc.top, rc.right, rc.bottom, 100, 100); //矩形圓角 //m_rgn.CreateEllipticRgn(rc.left,rc.top,rc.right,rc.bottom);//橢圓 SetWindowRgn(m_rgn, TRUE); return TRUE; // return TRUE unless you set the focus to a control }