참조 URL : http://www.codeproject.com/KB/dialog/SimpleIrregular.aspx

BOOL CTestDlg::OnInitDialog()
{
CDialog::OnInitDialog();

// Set the icon for this dialog.  The framework does this automatically
//  when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
    SetWindowLong(m_hWnd, GWL_STYLE, GetWindowLong(m_hWnd, GWL_STYLE) & (~(WS_CAPTION | WS_BORDER))); 
 
    CRect rect;
    GetWindowRect(&rect);
    int w = rect.Width();
    int h = rect.Height();
    
    CRgn rgn1;
    CRgn rgn2;

#ifdef TEST_RECT
rgn1.CreateRectRgn(1, 1, w, h);
rgn2.CreateRectRgn(10, 10, w-10, h-10);
CombineRgn(rgn1, rgn1, rgn2, RGN_XOR);
#endif

#ifdef TEST_ELLIPSE
rgn1.CreateEllipticRgn(1, 1, w, h/2 + 30);
rgn2.CreateEllipticRgn(1, h/2 - 30, w, h);
CombineRgn(rgn1, rgn1, rgn2, RGN_OR);
#endif

    SetWindowRgn(static_cast<HRGN>(rgn1.GetSafeHandle()), TRUE);

    rgn1.Detach();
    rgn2.Detach();
   
return TRUE;  // return TRUE  unless you set the focus to a control
}
Posted by 띠깜
,