L_AnnGetUserHandle
#include "l_bitmap.h"
L_INT EXT_FUNCTION L_AnnGetUserHandle(hObject, nIndex, pAnnHandle)
HANNOBJECT hObject; |
/* handle to the annotation object with the user-defined handle */ |
L_INT32 nIndex; |
/* index of user handle to get */ |
pANNHANDLE pAnnHandle; |
/* pointer to a structure */ |
Gets information about the specified user-defined annotation handle. This function is available in the Document/Medical Toolkits.
Parameter |
Description |
hObject |
Handle to the annotation object for which to get the user handle. |
nIndex |
Index of user handle to get. The index is zero based. Passing a negative value returns ERROR_INV_PARAMETER. |
pAnnHandle |
Pointer to structure to be updated with the user handle. |
Returns
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
Comments
Before calling this function, you must create the annotation object.
Call this function to get information about an existing user-defined annotation handle.
If successful, the entire pAnnHandle structure is filled. The pAnnHandle->uFlags field is ignored. For more information, refer to ANNHANDLE.
Required DLLs and Libraries
LTANN For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application. |
Platforms
Windows 95 / 98 / Me, Windows 2000 / XP.
See Also
Example
// This example displays information about the first user handle in an annotation object
L_VOID DumpAnnHandle(L_UINT uIndex, pANNHANDLE pAnnHandle)
{
L_TCHAR szMsg[400];
if (pAnnHandle)
{
wsprintf(szMsg, TEXT("uIndex %d\nnSize: %d\nnID: %d\n aptContainer[%f,%f]\nptClient[%d,%d]\nbVisible: %s\ncrPen: 0x%x\ncrFill: 0x%x\nnShape: %s\nhCursor: %s\n"),
uIndex,
pAnnHandle->uStructSize,
pAnnHandle->nID,
pAnnHandle->aptContainer.x, pAnnHandle->aptContainer.y,
pAnnHandle->ptClient.x, pAnnHandle->ptClient.y,
pAnnHandle->bVisible ? TEXT("Visible") : TEXT("Not Visible"),
pAnnHandle->crPen,
pAnnHandle->crFill,
pAnnHandle->nShape == ANNHANDLE_SHAPE_SQUARE ? TEXT("Square") : TEXT("Circle"),
pAnnHandle->hCursor ? TEXT("Cursor") : TEXT("No Cursor")
);
MessageBox(NULL, szMsg, TEXT(""), MB_OK);
}
}
L_VOID ExampleAnnGetUserHandle(HANNOBJECT hObject)
{
L_UINT uCount;
ANNHANDLE AnnHandle;
// Get the total count of user handles
L_AnnGetUserHandles(hObject, NULL, &uCount);
if (uCount > 0)
{
memset(&AnnHandle, 0, sizeof(ANNHANDLE));
AnnHandle.uStructSize = sizeof(&AnnHandle);
L_AnnGetUserHandle(hObject, 0, &AnnHandle);
DumpAnnHandle(0, &AnnHandle);
}
else
MessageBox(NULL, TEXT("No User Handles!"), TEXT("Error"), MB_OK);
}