CreateRectRgn :
BOOL CreateRectRgn( int x1, int y1, int x2, int y2 );
CombineRgn :
int CombineRgn( CRgn* pRgn1, CRgn* pRgn2, int nCombineMode );
SetWindowRgn :
void SetRectRgn( int x1, int y1, int x2, int y2 );
void SetRectRgn( LPCRECT lpRect );
API///////////////////////////////////////////////////////////////////////////
[code]
WM_CREATE 메세지에서 처리를 해 주시면 됩니다.
void OnCreate(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
{
HRGN WindowRgn, HoleRgn;
WindowRgn = CreateRectRgn( 0, 0, 400, 300);
HoleRgn = CreateRectRgn(100, 100, 200, 200);
CombineRgn(WindowRgn, WindowRgn, HoleRgn, RGN_DIFF);
SetWindowRgn(hwnd, WindowRgn, TRUE);
DelectObject(HoleRgn);
}[/code]
MFC///////////////////////////////////////////////////////////////////////////
App : Member variable - CRgn WindowRgn, HoleRgn;
[code]
BOOL CRgnTestApp::InitInstance()
{
............... 생 략.................
// The one and only window has been initialized, so show and update it.
WindowRgn.CreateRectRgn( 0, 0, 400, 300);
HoleRgn.CreateRectRgn(100, 100, 200, 200);
WindowRgn.CombineRgn(&WindowRgn,&HoleRgn, RGN_DIFF);
m_pMainWnd->SetWindowRgn(WindowRgn, TRUE);
HoleRgn.DeleteObject();
............... 생 략.................
}[/code]
BOOL CreateRectRgn( int x1, int y1, int x2, int y2 );
CombineRgn :
int CombineRgn( CRgn* pRgn1, CRgn* pRgn2, int nCombineMode );
SetWindowRgn :
void SetRectRgn( int x1, int y1, int x2, int y2 );
void SetRectRgn( LPCRECT lpRect );
API///////////////////////////////////////////////////////////////////////////
[code]
WM_CREATE 메세지에서 처리를 해 주시면 됩니다.
void OnCreate(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam)
{
HRGN WindowRgn, HoleRgn;
WindowRgn = CreateRectRgn( 0, 0, 400, 300);
HoleRgn = CreateRectRgn(100, 100, 200, 200);
CombineRgn(WindowRgn, WindowRgn, HoleRgn, RGN_DIFF);
SetWindowRgn(hwnd, WindowRgn, TRUE);
DelectObject(HoleRgn);
}[/code]
MFC///////////////////////////////////////////////////////////////////////////
App : Member variable - CRgn WindowRgn, HoleRgn;
[code]
BOOL CRgnTestApp::InitInstance()
{
............... 생 략.................
// The one and only window has been initialized, so show and update it.
WindowRgn.CreateRectRgn( 0, 0, 400, 300);
HoleRgn.CreateRectRgn(100, 100, 200, 200);
WindowRgn.CombineRgn(&WindowRgn,&HoleRgn, RGN_DIFF);
m_pMainWnd->SetWindowRgn(WindowRgn, TRUE);
HoleRgn.DeleteObject();
............... 생 략.................
}[/code]
'Windows > MFC' 카테고리의 다른 글
Explorer Bar (0) | 2013.10.02 |
---|---|
CMenu Inner Image (메뉴안에 이미지 넣기) (0) | 2013.10.02 |
[CStatic][CFont] color change, transferant (0) | 2013.10.02 |
CEdit에서 엔터(enter)치면 해당 Command 실행하기 (0) | 2013.10.02 |
CComboBox GetLBText내용 가져오기 (0) | 2013.10.02 |