L_AnnGetHyperlink

#include "l_bitmap.h"

L_INT EXT_FUNCTION L_AnnGetHyperlink(hObject, puType, puMsg, pwParam, pLink)

HANNOBJECT hObject;

/* handle of the annotation object */

L_UINT L_FAR * puType;

/* address of the variable to be updated with the hyperlink type */

L_UINT L_FAR * puMsg;

/* address of the variable to be updated with the user defined message */

WPARAM L_FAR * pwParam;

/* address of the variable to be updated with the value of wParam */

L_TCHAR L_FAR * pLink;

/* Character string containing the hyperlink string */

Gets the hyperlink information of the specified annotation object. This function is available in the Document/Medical Toolkits.

Parameter

Description

hObject

Handle of the annotation object.

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.

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.

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.

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.

Returns

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, you must first call L_AnnGetHyperlinkLen and get the string length, allocate a buffer large enough to store the string and the NULL at the end, and then call L_AnnGetHyperlink. Note that the length does NOT account for the null at the end of the string.

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

Functions:

L_AnnSetHyperlink, L_AnnGetHyperlinkLen

Topics

Annotation Functions (Document/Medical only): Hyperlinks

 

Annotation Objects - Automated Features

 

Implementing an Automated Annotation Program

 

Obtaining Annotation Object Information

Example

For complete sample code, refer to the Annotate example.

void TestAnnGetHyperlink(HWND hWnd, HANNOBJECT hAnnObject)
{
 WPARAM wParam;
 L_UINT uLen, uType, uMsg;
 L_TCHAR Buffer[2048];

 L_AnnGetHyperlinkLen(hAnnObject, &uLen);
 uLen = uLen + 1;
 L_AnnGetHyperlink(hAnnObject, &uType, &uMsg, &wParam, Buffer);

 if (uType == ANNLINK_NONE)
  MessageBox(hWnd, TEXT("Object has no hyperlink."), TEXT("Notice"), MB_OK);
 else if ((uType == ANNLINK_WEBPAGE) || (uType == ANNLINK_RUN))
  MessageBox(hWnd, Buffer, TEXT("Message"), MB_OK);
 else
  MessageBox(hWnd, TEXT("Hyperlink does not have a string.\n"), TEXT("Message"), MB_OK);
 return;
}