EM_AUTOURLDETECT Message


An EM_AUTOURLDETECT message enables or disables automatic detection of URLs by a rich edit control.

Syntax

To send this message, call the SendMessage function as follows.
lResult = SendMessage(     // returns LRESULT in lResult
   (HWND) hWndControl,     // handle to destination control
   (UINT) EM_AUTOURLDETECT,     // message ID
   (WPARAM) wParam,     // = (WPARAM) () wParam;
   (LPARAM) lParam     // = (LPARAM) () lParam;
);

Parameters

wParam
Specify TRUE to enable automatic URL detection or FALSE to disable it.
lParam
This parameter is not used; it must be zero.

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 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 URLs that begin with the following prefixes:

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  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.

Message Information

HeaderDeclared in Richedit.h
Minimum operating systems Windows 95 with Rich Edit 2.0 , Windows 98, Windows NT 4.0

See Also

Rich Edit Controls, CHARFORMAT2, EN_LINK