Gets the hyperlink information of the annotation object.
#include "ltwrappr.h"
virtual L_INT LAnnotation::GetHyperlink(puType, puMsg, pwParam, pLink, puLen)
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. |
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.
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.
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.
Pointer to an integer variable (L_SIZE_T) that will be updated with the length of the hyperlink string.
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
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, you must first call LAnnotation::GetHyperlinkLen and get the string length, allocate a buffer large enough to store the string and the NULL at the end, and then call LAnnotation::GetHyperlink. Note that the length does NOT account for the null at the end of the string.
Win32, x64.
L_INT LAnnotation_GetHyperlinkExample(LAnnotation& LeadAnn)
{
L_INT nRet;
L_UINT uType; // variable to hold hyperlink type
L_UINT uMsg; // variable to hold hyperlink msg
WPARAM wParam; // variable to hold hyperlink msg param
L_TCHAR Buffer[2048]; // buffer to hold hyperlink string
L_SIZE_T uLen ; // length of hyperlink
L_TCHAR szMessage[80];
nRet = LeadAnn.GetHyperlink( &uType, &uMsg, &wParam, Buffer,NULL);
if(nRet != SUCCESS)
return nRet;
if (uType != ANNLINK_WEBPAGE)
{
nRet = LeadAnn.SetHyperlink(ANNLINK_WEBPAGE, 0, 0, TEXT("https://www.leadtools.com "), ANNFLAG_RECURSE|ANNFLAG_SELECTED);
if(nRet != SUCCESS)
return nRet;
}
// get the length of the hyperlink property
uLen = LeadAnn.GetHyperlinkLen();
wsprintf(szMessage, TEXT("Length of hyperlink = %u\n"),uLen);
MessageBox(NULL,szMessage, TEXT("Hyperlink"),MB_OK) ;
return SUCCESS;
}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.