다음을 통해 공유


CWnd::UpdateWindow

전송 하 여 클라이언트 영역 업데이트는 WM_PAINT 업데이트 영역이 비어 있지 않은 경우 메시지.

void UpdateWindow( );

설명

UpdateWindow 보내는 멤버 함수는 WM_PAINT 응용 프로그램 큐를 사용 하지 않고 직접 메시지. 업데이트 영역이 비어 있는 경우 WM_PAINT 보내지지 않습니다.

예제

// In this example a rectangle is drawn in a view.  
// The OnChangeRect() function changes the dimensions  
// of the rectangle and then calls CWnd::Invalidate() so the  
// client area of the view will be redrawn next time the 
// window is updated.  It then calls CWnd::UpdateWindow  
// to force the new rectangle to be painted. 

void CMdiView::OnChangeRect() 
{
   // Change Rectangle size.
   m_rcBox = CRect(20, 20, 210, 210);

   // Invalidate window so entire client area  
   // is redrawn when UpdateWindow is called.
   Invalidate();   

   // Update Window to cause View to redraw.
   UpdateWindow();
}

// On Draw function draws the rectangle. 
void CMdiView::OnDraw(CDC* pDC)
{
   // Other draw code here.

   pDC->Draw3dRect(m_rcBox, 0x00FF0000, 0x0000FF00);
}

요구 사항

헤더: afxwin.h

참고 항목

참조

CWnd 클래스

계층 구조 차트

UpdateWindow

CWnd::RedrawWindow