#include "ltivw.h"
L_LTIVW_API L_INT L_DispContainerGetBounds(hCon, lpRect, uFlags)
Gets the bounding rectangle for the container.
Handle to the container.
A pointer to a RECT structure to be updated with the bounding rectangle of the container.
Reserved for future use. Pass 0.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
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
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;
}