AnnHitTestExt example for C++ 5 and later
//'This example uses the caller's mouse coordinates to get the handle
//' to the annotation object at the specified coordinates.
//' The part of the clicked annotation is displayed in the Output window.
//' If the result of the hittest is a user handle, additional information about the handle is displayed.
void CTutorDlg::ExampleAnnHitTestExt(long hContainer , long PointToTestX,long PointToTestY, long hAnnObject )
{
CString szResult;
m_pRasterAnn->AnnHitTestExt( hContainer, PointToTestX, PointToTestY);
If (m_pRasterAnn->.ObjectHitHandle == 0 )
{
MessageBox(TEXT("There is no object to hit test."));
Return ;
}
switch (m_pRasterAnn->GetPositionResult())
{
case ANN_HIT_NONE:
szResult = TEXT("ANN_HIT_NONE");
case ANN_HIT_BODY:
szResult = TEXT("ANN_HIT_NONE");
case ANN_HIT_NAME:
szResult = TEXT("ANN_HIT_NAME");
case ANN_HIT_HANDLE:
szResult.Format(TEXT("ANN_HIT_HANDLE HandleIndex = %d \n\t HandleId = %d "),m_pRasterAnn->HandleIndex, m_pRasterAnn->HandleID);
case ANN_HIT_USER_HANDLE:
szResult.Format(TEXT("ANN_HIT_USER_HANDLE HandleIndex = %d \n\t HandleId = %d "),m_pRasterAnn->HandleIndex, m_pRasterAnn->HandleID);
}
MessageBox(szResult);
}