카테고리 없음

[Win32 API] 다이얼로그의 모서리 처리

써드아이 2008. 2. 6. 21:07

const RECT m_DiffRect[] =
{
 {0,158,1,160},
 {0,160,2,161},
 {0,161,3,162},
 {0,162,4,163},
 {0,163,5,164},
 {0,164,6,165},
 {0,165,9,166}, //LeftBottom White
 
 {357,158,358,160},
 {356,160,358,161},
 {355,161,358,162},
 {354,162,358,163},
 {353,163,358,164},
 {352,164,358,165},
 {350,165,358,166}, //RightBottom White
};

m_hWndRgn = CreateRectRgn( 0, 0, 358, 166 );

for ( int i = 0; i < (7*2); i++ )
{
  HRGN hr = CreateRectRgn( m_DiffRect[i].left, m_DiffRect[i].top, m_DiffRect[i].right, m_DiffRect[i].bottom );
 
  VERIFY( CombineRgn( m_hWndRgn, m_hWndRgn, hr, RGN_DIFF ) != ERROR );
 
  if ( hr )
   DeleteObject( hr );
 }
 
 SetWindowRgn( m_hWndRgn, TRUE );
 SelectClipRgn( (HDC) GetDC(), m_hWndRgn );


void CUpgradeDlg::OnDestroy()
{

 if ( m_hWndRgn )   
  DeleteObject( m_hWndRgn );
}