참조 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
}
'프로그래밍 팁 > etc' 카테고리의 다른 글
MessageBoxTimeout API(문서화 되지않은 기능) (1) | 2012.02.01 |
---|---|
CreateCompatibleBitmap 주의사항 (2) | 2011.12.03 |
비스타에서 권한무시 메세지 전송방법 (0) | 2011.10.12 |
[드래그 & 드롭]어플 -> 바탕화면 (0) | 2011.10.11 |
CreateEvent를 활용한 WaitForSingleObject (0) | 2011.10.05 |