L_DispContainerGetWindowHandle

#include "ltivw.h"

L_LTIVW_API L_HWND L_DispContainerGetWindowHandle(hCon, uFlags)

Returns a handle to the specified container window.

Parameters

HDISPCONTAINER hCon

Handle to the container.

L_UINT uFlags

Reserved for future use. Pass 0.

Returns

Value Meaning
> 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

See Also

Functions

Topics

Example

This function returns the bounding rectangle 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;  
} 

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

LEADTOOLS Medical Image Viewer C API Help