LImageViewerCell::GetWindowHandle

#include "ltwrappr.h"

HWND LImageViewerCell::GetWindowHandle (uFlags);

Returns a handle to the specified cell window.

Parameters

L_UINT uFlags

Reserved for future use. Pass 0.

Returns

Value Meaning
> 0 Handle to the cell 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 cell's window.

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 MyLImageViewer_GetWindowHandleExample(LImageViewer& ImageViewer, L_INT nCellIndex,RECT * lpRect)  
{ 
   L_INT    nRet = 0; 
   RECT     rcRect1, rcRect2 ;  
   POINT    pt ;  
   CWnd     wndContainer, wndCell ;  
 
   // Check whether the cell index is valid or not.  
   L_INT nCount = ImageViewer.GetCellCount(0);  
 
   if (nCellIndex < 0 || nCellIndex >= nCount)  
   { 
      MessageBox(NULL, TEXT("cell index is not valid!"), NULL, MB_OK) ;  
      return nRet; 
   } 
 
   // Get the cell's bounding rectangle,  
   //the coordinates are relative to the upper left corner of the container window. 
   nRet = ImageViewer.GetCellBounds(nCellIndex, &rcRect1, 0);  
   if(nRet != SUCCESS) 
      return nRet; 
 
   pt.x = rcRect1.left;  
   pt.y = rcRect1.top;  
 
   // Get the container window handle.  
   nRet = wndContainer.Attach(ImageViewer.GetWindowHandle(0));  
   wndContainer.ClientToScreen(&pt);  
 
   // Get the window handle of the cell 
   nRet = wndCell.Attach(ImageViewer.GetCellWindowHandle(nCellIndex, 0));  
 
   // Get the client rect for the cell.  
   wndCell.GetClientRect(&rcRect2);  
 
   OffsetRect(&rcRect2, pt.x, pt.y);  
   CopyRect(lpRect, &rcRect2);  
 
   wndContainer.Detach() ;  
   wndCell.Detach() ;  
 
   return SUCCESS; 
} 

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

LEADTOOLS Medical Image Viewer C++ Class Library Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2021 LEAD Technologies, Inc. All Rights Reserved.