#include "l_bitmap.h"
L_LTIVW_API L_INT EXT_FUNCTION L_DispContainerGetRegionCallBack(hCellWnd, ppfnCallBack, ppUserData)
Gets the current action callback function along with the user data, which were set using L_DispContainerSetRegionCallBack.
A handle to the window that represents the Medical Viewer Cell.
Pointer to a pointer to a callback function to be updated with the last pre-paint callback function set using L_DispContainerSetPrePaintCallBack.
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.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
Required DLLs and Libraries
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;
}