When we have a RichEdit control and send it an EM_AUTOURLDETECT
message with WPARAM set to TRUE, it nicely hightlights the detected URLs and sends the EN_LINK
I just knocked up a basic WTL dialog based app containing a riched20 control and the following works fine:
CRichEditCtrl richedit = GetDlgItem(IDC_RICHEDIT);
richedit.SetAutoURLDetect(TRUE);
richedit.SetWindowText(_T("http://www.stackoverflow.com"));
I have some old MFC code that does something similar, albeit with ES_STREAM, and it works OK too.
FWIW the WTL CRichEditCtrl
wrapper is pretty thin. SetAutoURLDetect
simply calls SendMessage
passing it EM_AUTOURLDETECT
.
I am compiling with _RICHEDIT_VER
set to 0x0200
FWIW.