L_AnnSetHyperlink

#include "l_bitmap.h"

L_LTANN_API L_INT L_AnnSetHyperlink(hObject, uType, uMsg, wParam, pLink, uFlags)

HANNOBJECT hObject;

handle of the annotation object

L_UINT uType;

hyperlink type

L_UINT uMsg;

 user-defined message value 

WPARAM wParam;

wParam value to be passed to the user defined message

L_TCHAR *pLink;

hyperlink string

L_UINT uFlags;

flags to determine which objects to process

Sets the hyperlink type and parameters of one or more annotation objects.

Parameter Description
hObject Handle to the annotation object.
uType Constant that specifies the object's hyperlink type. Possible values 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.
uMsg Value indicating a user defined message that will be sent to the window associated with the annotation object if uType is ANNLINK_USERMSG. This parameter will be ignored if uType is anything other than ANNLINK_USERMSG.
wParam wParam value that is passed to the user defined message if uType is ANNLINK_USERMSG.
pLink Character string containing the program to run when the object is clicked, if uType is ANNLINK_RUN. If uType is ANNLINK_WEBPAGE, it is the URL to be accessed by the default browser. This string should be NULL terminated. This parameter is ignored if uType contains any other value.
uFlags Flags that determine which objects to process. Most of the flags apply only to container objects. You can combine values when appropriate by using a bitwise OR ( | ). The following are valid values:
  Value Meaning
  0 Process only the specified object.
  ANNFLAG_SELECTED [0x0001] Process only objects that have the selected property set to TRUE. For getting and setting the selected property, use the L_AnnGetSelected and L_AnnSetSelected functions.
  ANNFLAG_NOTTHIS [0x0004] Process only one level of objects within the specified container, not the container itself. If there are containers within the container, they are modified, but the objects within them are not.
  ANNFLAG_RECURSE [0x0008] Process objects within a container, and within any subcontainers, down to any level.
  ANNFLAG_NOTCONTAINER [0x0002] (Used with ANNFLAG_RECURSE) Process objects within containers, not the containers themselves.
  ANNFLAG_NOINVALIDATE [0x0010] Do not invalidate the affected rectangle in the window. Use this to avoid generating unwanted paint messages.

Returns

SUCCESS

The function was successful.

< 1

An error occurred. Refer to Return Codes.

Comments

The data pointed to by pLink is copied. If you dynamically allocated a buffer to hold the data, you should free the string after calling this function.

All objects can be hyperlinked, however, locked objects do not generate hyperlink actions.

Default hyperlink type is ANNLINK_NONE.

For the objects that already have an associated action in run mode (hotspot, button, audio), the hyperlink is processed before their associated action.

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

Win32, x64.

See Also

Functions:

L_AnnGetHyperlink, L_AnnGetHyperlinkLen, L_AnnSetHyperlinkMenuEnable, L_AnnGetHyperlinkMenuEnable, L_AnnGetSelected, L_AnnSetSelected

Topics

Annotation Functions (Document/Medical only): Hyperlinks

 

Implementing Annotation Hyperlinks

 

Implementing an Automated Annotation Program

 

Altering Annotation Object Settings

Example

L_INT AnnSetHyperlinkExample(HANNOBJECT hAnnObject) 
{ 
   L_INT nRet; 
   /* change the automation object and all selected objects in the container 
   to have a webpage hyperlink */ 
   nRet = L_AnnSetHyperlink(hAnnObject, ANNLINK_WEBPAGE, 0, 0, TEXT("https://www.leadtools.com"), 0); 
   if(nRet != SUCCESS) 
      return nRet; 
   /* if you wish to have all objects in the container set with the same hyperlink, uncomment the next line */ 
   /*L_AnnSetHyperlink(hContainer, ANNLINK_WEBPAGE, 0, 0, TEXT("https://www.leadtools.com"), ANNFLAG_RECURSE|ANNFLAG_SELECTED);*/ 
   return SUCCESS; 
} 

Help Version 20.0.2018.2.25
Products | Support | Contact Us | Copyright Notices
© 1991-2018 LEAD Technologies, Inc. All Rights Reserved.
LEADTOOLS Raster Imaging C API Help