Available in LEADTOOLS Imaging Pro, Vector, Document, and Medical Imaging toolkits. |
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 ) ;
.
.
.
}