L_DispContainerGetBounds

#include "ltivw.h"

L_LTIVW_API L_INT L_DispContainerGetBounds(hCon, lpRect, uFlags)

Gets the bounding rectangle for the container.

Parameters

HDISPCONTAINER hCon

Handle to the container.

LPRECT lpRect

A pointer to a RECT structure to be updated with the bounding rectangle of the container.

L_UINT uFlags

Reserved for future use. Pass 0.

Returns

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

Comments

The coordinates of lpRect are relative to the parent window coordinates. If the container window has no parent, the coordinates will be relative to the screen coordinates.

To set the bounding rectangle for the container, call L_DispContainerSetBounds.

Required DLLs and Libraries

See Also

Functions

Topics

Example

This function determines whether the container's client area is different than its parent's.

L_INT DispContainerGetBoundsExample(HDISPCONTAINER hCon) 
{ 
   L_INT nRet; 
   RECT rcRect; 
   RECT rcParentRect; 
   HWND hWndParent; 
 
   // Get the container window's parent 
   hWndParent = GetParent(L_DispContainerGetWindowHandle (hCon, 0)); 
 
   // if the container has no parent then abort.  
   if (hWndParent == NULL)  
      return ERROR_NO_MEMORY ;  
 
   // Get the container's bonding rectangle.  
   nRet = L_DispContainerGetBounds(hCon, &rcRect, 0);  
   if(nRet != SUCCESS) 
      return nRet; 
 
   GetClientRect(hWndParent, &rcParentRect);  
 
   // check if the container's client area is different than the parent's client area.  
   if (((rcRect.right - rcRect.left ) != (rcParentRect.right - rcParentRect.left )) || ((rcRect.bottom - rcRect.top ) != (rcParentRect.bottom - rcParentRect.top )))  
   { 
      nRet = L_DispContainerSetBounds(hCon, &rcParentRect, 0);  
      if(nRet != SUCCESS) 
         return nRet; 
   } 
   return SUCCESS; 
} 

Help Version 21.0.2020.8.21
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2020 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Medical Image Viewer C API Help