LImageViewer::GetWindowHandle

#include "ltwrappr.h"

HWND LImageViewer::GetWindowHandle (uFlags);

Returns a handle to the specified container window.

Parameters

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.

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 LImageViewer_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 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++ Class Library Help