L_ContainerCreate
#include "LtCon.h"
L_LTCON_API L_INT L_ContainerCreate (pContainer, hwndOwner)
|
pCONTAINERHANDLE pContainer; |
/* pointer to a container handle */ |
|
L_HWND hwndOwner; |
/* window handle */ |
Creates a container and attaches it to a user defined window.
|
Parameter |
Description |
|
pContainer |
Pointer to a container handle. |
|
hwndOwner |
Handle of the window that owns the container. |
Returns
|
SUCCESS |
The function was successful. |
|
< 1 |
An error occurred. Refer to Return Codes. |
Comments
The container owner window should have CS_DBLCLKS in its class style. Otherwise some container functions will not work.
L_ContainerInit must be called before calling this function.
Required DLLs and Libraries
|
LTCON For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application |
See Also
|
Functions: |
L_ContainerIsValid, L_ContainerInit, L_ContainerSetMetrics, L_ContainerFree. |
|
Topics: |
Example
This example shows the minimum requirements to start using some container.
L_INT ContainerCreateExample(HWND hWnd, pCONTAINERHANDLE * ppLeadContainer)
{
L_INT nRet;
CONTAINERMETRICS Metrics ;
/* Initialize the container handle */
nRet = L_ContainerInit( ppLeadContainer ) ;
if(nRet != SUCCESS)
return nRet;
/* Create the container and attach it to its owner window */
nRet = L_ContainerCreate( *ppLeadContainer, hWnd ) ;
if(nRet != SUCCESS)
return nRet;
nRet = L_ContainerIsValid( *ppLeadContainer );
if ( SUCCESS == nRet) /* the validity of the container handle */
{
/* Set the container object type to rectangle */
nRet = L_ContainerSetObjectType( *ppLeadContainer, CONTAINER_OBJECT_TYPE_RECT ) ;
if(nRet != SUCCESS)
return nRet;
/* Initiate the container metrics */
Metrics.nSize = sizeof ( CONTAINERMETRICS ) ;
Metrics.dwMask = CMF_LIMITS ;
/* Set the container limits to some value, all container inputs (after scaling) will be restricted to this range */
SetRect ( &Metrics.rcLimits, 0, 0, 500, 500 ) ;
/* Set the container metrics */
nRet = L_ContainerSetMetrics( *ppLeadContainer, &Metrics ) ;
}
return nRet;
}