EM_AUTOURLDETECT

[This is preliminary documentation and subject to change.]

Rich Edit 2.0 and later: Send an EM_AUTOURLDETECT message to enable or disable automatic detection of URLs by a rich edit control.

Rich Edit 1.0: This message is not supported.

EM_AUTOURLDETECT 
wParam = (WPARAM) bEnable;  // TRUE to enable, FALSE to disable
lParam = 0 ;                // not used;  must be zero 
 

Parameters

bEnable
Value of wParam. Specify TRUE to enable automatic URL detection, or FALSE to disable it.

Return Values

If the message succeeds, the return value is zero.

If the message fails, the return value is a nonzero value. For example, the message may fail due to insufficient memory.

Remarks

If automatic URL detection is enabled, the rich edit control scans any modified text to determine whether the text matches the format of a URL. The control detects several URL formats, including the following formats:

http:<text with no whitespace>
file:<text with no whitespace>
mailto:
<text with no whitespace>
ftp:
<text with no whitespace>
https:
<text with no whitespace>
gopher:
<text with no whitespace>
nntp:
<text with no whitespace>
prospero:
<text with no whitespace>
telnet:
<text with no whitespace>
news:
<text with no whitespace>
wais:
<text with no whitespace>

When it detects a URL, the control sets the CFE_LINK effect bit for all characters in the URL string. The control highlights the URL string by underlining it and setting the text color.

Note that when automatic URL detection is enabled, the rich edit control removes the CFE_LINK effect from modified text that does not have a URL format recognized by the control. If your application uses the CFE_LINK effect to mark other types of text, do not enable automatic URL detection.

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.

QuickInfo

  Windows NT: Requires version 4.0 or later.
  Windows: Requires Windows 95 or later.
  Windows CE: Unsupported.
  Header: Declared in richedit.h.

See Also

Rich Edit Controls Overview, Rich Edit Messages, CHARFORMAT2, EN_LINK