CRichEditCtx.SetAutoUrlDetectmethod
Syntax
FUNCTION SetAutoUrlDetect (BYVAL fUrlDetect AS LONG) AS HRESULT
AutoUrlDetect — one description covers them all.Parameters
| Name | Description | |
|---|---|---|
fUrlDetect | (SET) Specify 0 to disable automatic link detection, or one of the following values to enable various kinds of detection. |
Return value
(GET) If auto-URL detection is active, the return value is true (-1). If auto-URL detection is inactive, the return value is false (0).
(SET) 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 or an invalid detection option.
Description
Gets/sets whether the auto URL detection is turned on in the rich edit control.
Remarks
If automatic URL detection is enabled (that is, fUrlDetect 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). 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.
Example
(GET) PROPERTY AutoUrlDetect () AS BOOLEAN (SET) PROPERTY AutoUrlDetect (BYVAL fUrlDetect AS LONG)
Reference
- Defined in AfxNova/CRichEditCtx.inc:802
- Documented in Windows/WIndows Controls/RichEdit/CRichEditCtx Class.md
- Topic: CRichEditCtx Class