Click to Rate and Give Feedback
MSDN
MSDN Library
User Interface
Windows Controls
Control Library
Rich Edit
Messages
 EM_AUTOURLDETECT Message
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
   hWndControl,           // (HWND) handle to destination control
   EM_AUTOURLDETECT,      // (UINT) message ID
   wParam,                // = () wParam; 
   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:

  • http:
  • file:
  • mailto:
  • ftp:
  • https:
  • gopher:
  • nntp:
  • prospero:
  • telnet:
  • news:
  • wais:

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

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Site Feedback
Page view tracker