The information in this article applies to:
SUMMARYThis article describes how to work with the invalidated rectangle that is created when a window is resized. MORE INFORMATIONTo optimize painting in an MFC program, you can usually call GetClipBox() in your view's OnDraw() function to get the invalid rectangle and paint only in this area. However, if the user resizes the window, GetClipBox() l always returns the whole client area. This happens because the "window class" used for CView and CFrameWnd has the styles CS_VREDRAW and CS_HREDRAW. These styles cause the whole window to be invalidated whenever the window is resized. To work around this problem, you have to register your own window class for the view and the frame which do not have the class styles of CS_VREDRAW and CS_HREDRAW. You can register the class name in InitApplication() and use the class name in PreCreateWindow(). Sample Code
Additional query words:
Keywords : kbMFC KbUIDesign kbVC kbVC152 kbVC400 kbVC410 kbVC420 kbVC500 kbVC600 |
Last Reviewed: January 25, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |