L_AnnGetHyperlink

Summary

Gets the hyperlink information of the specified annotation object.

Syntax

#include "l_bitmap.h"

L_LTANN_API L_INT L_AnnGetHyperlink(hObject, puType, puMsg, pwParam, pLink, puLen)

Parameters

HANNOBJECT hObject

Handle of the annotation object.

L_UINT * puType

Address of the variable to be updated with the value indicating the hyperlink type. Possible hyperlink types are:

Value Meaning
ANNLINK_NONE [0x0000] Object has no hyperlink.
ANNLINK_LTANNEVENT [0x0001] WM_LTANNEVENT message will be sent with LTANNEVENT_HYPERLINK
ANNLINK_USERMSG [0x0002] The user defined message will be sent with wParam as the wParam message of this function and lParam containing the handle of the object.
ANNLINK_RUN [0x0003] The program specified in pLink will be run. Both the program and the command line parameters have to be specified in pLink.
ANNLINK_WEBPAGE [0x0004] The web page with the URL specified in pLink will be opened in the current browser. Note that not all web browsers accept a page on the command line. Some will simply go to their default home page.

L_UINT * puMsg

Address of the variable to be updated with the value of the user defined message. This parameter is only valid if the value pointed to by puType is ANNLINK_USERMSG.

WPARAM * pwParam

Address of the variable to be updated with the value of wParam. This parameter is only valid if the value pointed to by puType is ANNLINK_USERMSG.

L_TCHAR * pLink

Character string containing the hyperlink string. This parameter is valid only if the value pointed to by puType is ANNLINK_RUN or ANNLINK_WEBPAGE. If puType points to ANNLINK_RUN, pLink contains the name of the program to run and all required command line parameters. If puType points to ANNLINK_WEBPAGE, pLink contains the URL of the Web page to access.

L_SIZE_T * puLen

Pointer to an integer variable (L_SIZE_T) that will be updated with the length of the hyperlink string.

Returns

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

Comments

Objects with a hyperlink of type ANNLINK_RUN or ANNLINK_WEBPAGE have a hyperlink string associated with them. To see what the hyperlink string of an object is, first call L_AnnGetHyperlink passing NULL for the pLink parameter. The length of the hyperlink string is returned in the *puLen argument. Allocate a buffer large enough to store the string and the NULL at the end, and then call L_AnnGetHyperlink again, passing the pointer to the allocated buffer for the pLink argument. Note that the length does NOT account for the null at the end of the string.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Topics

Example

For a complete sample code, refer to the \Examples\Annotation\C\Annotate demo.

L_INT AnnGetHyperlinkExample(HANNOBJECT hAnnObject) 
{ 
   L_INT    nRet; 
   WPARAM   wParam; 
   L_UINT   uType, uMsg; 
   L_TCHAR  Buffer[2048]; 
   L_SIZE_T zLen; 
 
   nRet = L_AnnGetHyperlinkLen(hAnnObject, &zLen); 
   if (nRet != SUCCESS) 
      return nRet; 
 
   zLen = zLen + 1; 
   nRet = L_AnnGetHyperlink(hAnnObject, &uType, &uMsg, &wParam, Buffer, &zLen); 
   if (nRet != SUCCESS) 
      return nRet; 
 
   switch (uType) 
   { 
   case ANNLINK_NONE: 
      _tprintf(_T("%s"), TEXT("Notice: Object has no hyperlink.")); 
      break; 
   case ANNLINK_WEBPAGE: 
   case ANNLINK_RUN: 
      _stprintf_s(Buffer, TEXT("Message: %s"), Buffer); 
      _tprintf(_T("%s"), Buffer); 
      break; 
   default: 
      _tprintf(_T("%s"), TEXT("Message: Hyperlink does not have a string.\n")); 
      break; 
   } 
 
   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 Raster Imaging C API Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.