L_DispContainerGetRegionCallBack

Summary

Gets the current action callback function along with the user data, which were set using L_DispContainerSetRegionCallBack.

Syntax

#include "ltivw.h"

L_LTIVW_API L_INT EXT_FUNCTION L_DispContainerGetRegionCallBack(hCellWnd, ppfnCallBack, ppUserData)

Parameters

L_HWND hCellWnd

A handle to the window that represents the Medical Viewer Cell.

DISPCONTAINERREGIONCALLBACK * ppfnCallBack

Pointer to a pointer to a callback function to be updated with the last pre-paint callback function set using L_DispContainerSetPrePaintCallBack.

LPVOID * ppUserData

Void pointer to be updated with the value of user defined data associated with the tag callback. If you are not interested in the user-defined data, pass NULL for this parameter.

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Required DLLs and Libraries

See Also

Functions

Topics

Example

This function will make the cell set the region handle for all the frame if the user create or updated a region on one of the frames.

L_INT EXT_CALLBACK RegionCallBack(HWND hCellWnd, 
                                  HRGN     hRgn, 
                                  L_INT    nCellIndex, 
                                  L_INT    nSubCellIndex, 
                                  L_UINT   uOperation, 
                                  L_VOID * pUserData) 
 
{ 
   UNREFERENCED_PARAMETER(hRgn); 
   UNREFERENCED_PARAMETER(nCellIndex); 
   UNREFERENCED_PARAMETER(uOperation); 
   UNREFERENCED_PARAMETER(pUserData); 
   L_INT          nCount; 
   HBITMAPLIST    hBitmapList; 
   L_HRGN         hSubCellRgn; 
   L_INT          nI; 
 
   L_INT nRet = L_DispContainerGetCellBitmapList(hCellWnd, &hBitmapList, 0); 
   if (nRet != SUCCESS) 
      return nRet; 
 
   L_GetBitmapListCount(hBitmapList, (L_UINT *)&nCount); 
 
   L_DispContainerGetCellRegionHandle(hCellWnd, nSubCellIndex, &hSubCellRgn, 0); 
 
   for (nI = 0; nI < nCount; nI++) 
   { 
      if (nSubCellIndex == nI) 
         continue; 
 
      L_DispContainerSetCellRegionHandle(hCellWnd, nI, hSubCellRgn, L_RGN_SET, 0); 
   } 
 
   DeleteRgn(hSubCellRgn); 
   return SUCCESS; 
} 
 
 
 
L_INT DispContainerRegionHandleExample(HDISPCONTAINER hCon) 
{ 
   DISPCONTAINERREGIONCALLBACK oldCallBack; 
 
   if (L_DispContainerGetCellCount(hCon, 0) == 0) 
   { 
      MessageBox(NULL, TEXT("you must at least have one cell added to the viewer"), TEXT("No Cell attached"), MB_OK); 
      return FAILURE; 
   } 
 
   HWND hCellWnd = L_DispContainerGetCellWindowHandle(hCon, 0, 0); 
 
   L_DispContainerGetRegionCallBack(hCellWnd, &oldCallBack, NULL); 
   L_DispContainerSetRegionCallBack(hCellWnd, RegionCallBack, hCon); 
 
   return SUCCESS; 
} 

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

LEADTOOLS Medical Image Viewer C API Help

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.