LContainer::GetMetrics

#include "Ltwrappr.h"

L_INT LContainer::GetMetrics (pMetrics)

Gets the current container metrics information.

Parameters

pCONTAINERMETRICS pMetrics

Pointer to CONTAINERMETRICS structure to be updated with the current container metrics information.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Required DLLs and Libraries

See Also

Functions

Topics

Example

L_INT LContainer_GetMetricsExample(LContainer & lcont) 
{ 
   L_INT nRet; 
 
   CONTAINERMETRICS Metrics ; 
 
   HWND hwndOwner ; 
 
   RECT rcClient ; 
 
   /* Get the container owner */ 
 
   nRet = lcont.GetOwner (&hwndOwner ) ; 
   if(nRet != SUCCESS) 
      return nRet; 
 
   /* Get the owner client area */ 
 
   ::GetClientRect ( hwndOwner, &rcClient ) ; 
 
   /* Initiate the container metrics */ 
 
  Metrics.nSize = sizeof ( CONTAINERMETRICS ) ; 
 
  Metrics.dwMask = CMF_LIMITS ;  
 
   /* Get the container metrics */ 
 
   nRet = lcont.GetMetrics (&Metrics ) ; 
   if(nRet != SUCCESS) 
      return nRet; 
 
   if ( ! EqualRect ( &rcClient, &Metrics.rcLimits ) ) 
 
   { 
 
      CopyRect ( &Metrics.rcLimits, &rcClient ) ; 
 
      /* Set the new metrics */ 
 
      nRet = lcont.SetMetrics (&Metrics ) ; 
      if(nRet != SUCCESS) 
         return nRet; 
 
   } 
 
   return SUCCESS ; 
 
} 
Help Version 20.0.2020.4.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Container and Automation C++ Class Library Help