MFC

MFC 다이얼로그(대화상자) 테두리 수정

불량껌 2009. 12. 4. 13:02

테두리 영역은 비작업 영역이므로 OnPaint()가 아닌 OnNcPaint()에서 그려줘야한다.

WM_NCPAINT() 메세지를 재정의 하여 테두리를 그려준다.

void ComponentWindow::OnNcPaint()
{
    CDC* pDC = GetWindowDC( );

    //work out the coordinates of the window rectangle,
    CRect rect;
    GetWindowRect( &rect);
    rect.OffsetRect( -rect.left, -rect.top);

    //Draw a single line around the outside
    CBrush brush( RGB( 0, 0, 0));
    pDC->FrameRect( &rect, &brush);
    ReleaseDC( pDC);
}