L_DispContainerGetWindowHandle

#include "ltivw.h"

L_LTIVW_API L_HWND L_DispContainerGetWindowHandle(hCon, uFlags)

HDISPCONTAINER hCon;

/* handle to the container */

L_UINT uFlags;

/* reserved for future use */

Returns a handle to the specified container window.

Parameter

Description

hCon

Handle to the container.

uFlags

Reserved for future use. Pass 0.

Returns

> 0

Handle to the container window.

NULL

An error occurred. To get extended error information, call GetLastError, and refer to Return Codes.

Comments

This function gets a handle to the container's window. To get a handle to the container itself, call L_DispContainerGetHandle.

Required DLLs and Libraries

LTIVW

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_DispContainerCreate, L_DispContainerDestroy, L_DispContainerSetProperties, L_DispContainerGetProperties, L_DispContainerGetHandle, L_DispContainerGetCellWindowHandle

Topics:

Using the Image Viewer

 

Image Viewer Functions: Using the Image Viewer

Example

This function returns the bounding rect that specifies the absolute position of the cell.

 L_INT DispContainerGetWindowHandleExample(HDISPCONTAINER hCon,
                                                          L_INT          nCellIndex,
                                                          RECT         * lpRect)
{
   L_INT nRet;
   RECT  rcRect; 
   POINT pt; 
   HWND  hWndContainer, hWndCell; 

   // Check whether the cell index is valid or not. 
   L_INT nCount = L_DispContainerGetCellCount(hCon, 0); 
   if (nCellIndex < 0 || nCellIndex >= nCount) 
      return 0; 

   // Get the container window handle. 
   hWndContainer = L_DispContainerGetWindowHandle (hCon, 0); 

   // Get the cells bounding rectangle, the corrdinates is relative to the upperleft corner 
   // of the container window. 
   nRet = L_DispContainerGetCellBounds(hCon, nCellIndex, &rcRect, 0); 
   if(nRet != SUCCESS)
      return nRet;

   pt.x = rcRect.left; 
   pt.y = rcRect.top; 

   ClientToScreen(hWndContainer, &pt); 

   // Get the window handle of the cell
   hWndCell = L_DispContainerGetCellWindowHandle(hCon, nCellIndex, 0); 

   // Get the client rect for the cell. 
   GetClientRect(hWndCell, &rcRect); 

   OffsetRect(&rcRect, pt.x, pt.y); 

   CopyRect(lpRect, &rcRect); 

   return SUCCESS; 
}