EN_LINK notification code

A rich edit control sends EN_LINK notification codes when it receives various messages, for example, when the user clicks the mouse or when the mouse pointer is over text that has the CFE_LINK effect. A windowless rich edit control sends this notification by using the ITextHost::TxNotify method. The parent window of the control receives this notification code through a WM_NOTIFY message.

EN_LINK

    penLink = (ENLINK *) lParam; 

Parameters

wParam

The window ID retrieved by calling the GetWindowLong function with the GWL_ID value.

lParam

Pointer to an ENLINK structure. The structure contains an NMHDR structure, information about the notification code, and a CHARRANGE structure that indicates the range of characters that have the CFE_LINK effect.

Return value

Return zero to allow the control to proceed with its normal handling of the message.

Return a nonzero value to prevent the control from handling the message.

Windows 8: Return EN_LINK_DO_DEFAULT to direct the rich edit control to perform the default action.

Remarks

To receive EN_LINK notification codes when the link has focus, specify the ENM_LINK flag in the mask sent with the EM_SETEVENTMASK message.

If the link has no focus, to receive EN_LINK notification codes specify the SES_NOFOCUSLINKNOTIFY flag in the mask sent with the EM_SETEDITSTYLE message.

A rich edit control sends EN_LINK notification codes when it receives the following messages while the mouse pointer is over text that has the CFE_LINK effect:

The CFE_LINK effect typically identifies a range of text that contains an URL. Applications can handle the EN_LINK notification code by changing the mouse pointer when it is over the URL, or by starting a browser to view the location identified by the URL.

If you send the EM_AUTOURLDETECT message to enable automatic URL detection, the rich edit control automatically sets the CFE_LINK effect for modified text that it identifies as a URL.

Requirements

Requirement Value
Minimum supported client
Windows Vista [desktop apps only]
Minimum supported server
Windows Server 2003 [desktop apps only]
Header
Richedit.h

See also

CHARRANGE

EM_AUTOURLDETECT

ENLINK

ITextRange2::SetURL

NMHDR