Bewerken

Delen via


EM_AUTOURLDETECT message

Enables or disables automatic detection of hyperlinks by a rich edit control.

Parameters

wParam

Specify 0 to disable automatic link detection, or one of the following values to enable various kinds of detection.

Value Meaning
AURL_DISABLEMIXEDLGC
Windows 8: Disable recognition of domain names that contain labels with characters belonging to more than one of the following scripts: Latin, Greek, and Cyrillic.
AURL_ENABLEDRIVELETTERS
Windows 8: Recognize file names that have a leading drive specification, such as c:\temp.
AURL_ENABLEEA
This value is deprecated; use AURL_ENABLEEAURLS instead.
AURL_ENABLEEAURLS
Recognize URLs that contain East Asian characters.
AURL_ENABLEEMAILADDR
Windows 8: Recognize email addresses.
AURL_ENABLETELNO
Windows 8: Recognize telephone numbers.
AURL_ENABLEURL
Windows 8: Recognize URLs that include the path.

lParam

This parameter determines the URL schemes recognized if AURL_ENABLEURL is active. If lParam is NULL, the default scheme name list is used (see Remarks). Alternatively, lParam can point to a null-terminated string consisting of up to 50 colon-terminated scheme names that supersede the default scheme name list. For example, the string could be "news:http:ftp:telnet:". The scheme name syntax is defined in the Uniform Resource Identifiers (URI): Generic Syntax document on The Internet Engineering Task Force (IETF) website. Specifically, a scheme name can contain up to 13 characters (including the colon), must start with an ASCII alphabetic, and can be followed by a mixture of ASCII alphabetics, digits, and the three punctuation characters: ".", "+", and "-". The string type can be either char* or WCHAR*; the rich edit control automatically detects the type.

Return value

If the message succeeds, the return value is zero.

If the message fails, the return value is a nonzero value. For example, the message might fail due to insufficient memory, an invalid detection option, or an invalid scheme-name string.

If lParam contains more than 50 scheme names, the message fails with a return value of E_INVALIDARG.

Remarks

If automatic URL detection is enabled (that is, wParam includes AURL_ENABLEURL), the rich edit control scans any modified text to determine whether the text matches the format of a URL (or more generally in Windows 8 or later an IRI International Resource Identifier). If lParam is NULL, the control detects URLs that begin with the following scheme names:

  • callto
  • file
  • ftp
  • gopher
  • http
  • https
  • mailto
  • news
  • notes
  • nntp
  • onenote
  • outlook
  • prospero
  • tel
  • telnet
  • wais
  • webcal

When automatic link detection is enabled, the rich edit control removes the CFE_LINK effect from modified text that does not have a format recognized by the control. If your application uses the CFE_LINK effect to mark other types of text, do not enable automatic link detection. The rich edit control does not check whether a detected link exists; that responsibility belongs to the client.

A rich edit control sends the EN_LINK notification when it receives various messages while the mouse pointer is over text that has the CFE_LINK effect. For more information, see Automatic RichEdit Hyperlinks and RichEdit Friendly Name Hyperlinks.

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

CHARFORMAT2

EN_LINK