LImageViewer::GetWindowHandle

#include "ltwrappr.h"

HWND LImageViewer::GetWindowHandle (uFlags);

L_UINT uFlags;

/* reserved for future use */

Returns a handle to the specified container window. This function is available only in the Medical Imaging Suite toolkits.

Parameter

Description

uFlags

Reserved for future use. Must be zero.

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.

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:

LImageViewer::Destroy, LImageViewer::SetProperties, LImageViewer::GetProperties, Class Members

Topics:

Using the Image Viewer

 

Window Control/Image Viewer Functions: Using the Image Viewer

Example

// This function returns the bounding rect that specifies the absolute position of the cell. 
void GetWindowHandleExample(LImageViewer& ImageViewer, L_INT nCellIndex, RECT L_FAR * lpRect) 
{
   RECT  rcRect1, rcRect2 ; 
   POINT pt ; 
   CWnd wndContainer, wndCell ; 
   int nRet = 0 ; 
   
   // 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 ; 
   }
   
   // 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); 
   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() ; 
}