请问Invalidate(TRUE)是什么意思?我查MSDN没查出来

解决方案 »

  1.   

    使失效,这样就会发送WM_PAINT的消息,使窗口重画.
      

  2.   

    把该窗口区域加入到无效区域,在下次响应wm_paint的时候可以更新,
    同时擦去窗口背景。以下是msdn说明:CWnd::Invalidate
    void Invalidate( BOOL bErase = TRUE );ParametersbEraseSpecifies whether the background within the update region is to be erased.ResInvalidates the entire client area of CWnd. The client area is ed for painting when the next WM_PAINT message occurs. The region can also be validated before a WM_PAINT message occurs by the ValidateRect or ValidateRgn member function.The bErase parameter specifies whether the background within the update area is to be erased when the update region is processed. If bErase is TRUE, the background is erased when the BeginPaint member function is called; if bErase is FALSE, the background remains unchanged. If bErase is TRUE for any part of the update region, the background in the entire region, not just in the given part, is erased. Windows sends a WM_PAINT message whenever the CWnd update region is not empty and there are no other messages in the application queue for that window.