Processing the Window Activation Messages

When working in an MDI environment, each window may have its own bitmap data or transformations. Therefore, the toolkit data should be set to reflect the changes.

L_VOID OnMDIActivate ( HWND hWnd, L_BOOL active, HWND hActivate, HWND hDeactivate ) 
{ 
   PAINTXFORM XForm ; 
   HDC hdcCompatibility ; 
   RECT rcDCRect ; 
   . 
   . 
   . 
   /*set the painting toolkit data*/ 
   hdcCompatibility = GetDC ( hMDIChildWnd ) ; 
   L_PntSetMetrics ( pPaint, hdcCompatibility, MDIChildData.pBitmap, MDIChildData.hPalette ) ; 
   ReleaseDC ( hWnd, hdcCompatibility ) ; 
   XForm.nZoom    = MDIChildData.nZoomFactor ; 
   XForm.nXOffset = MDIChildData.nHscroll ; 
   XForm.nYOffset = MDIChildData.nVscroll ; 
   L_PntSetTransformation ( pPaint, &XForm ) ; 
   GetClientRect ( hMDIChildWnd, &rcDCRect ) ; 
   L_PntSetDCExtents ( pPaint, &rcDCRect ) ; 
   L_PntSetClipRgn (pPaint, MDIChildData.hClipRng ) ; 
   . 
   . 
   . 
} 

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS Digital Paint C API Help