Frage

I'm trying to implement URL detection for TRichEdit component using EM_AUTOURLDETECT message.
I have a problem with the following code

procedure TForm1.Button1Click(Sender: TObject);
var Mask: Word;
begin
  Mask := SendMessage(Handle, EM_GETEVENTMASK, 0, 0);
  SendMessage(Handle, EM_SETEVENTMASK, 0, Mask or ENM_LINK);
  SendMessage(Handle, EM_AUTOURLDETECT, Integer(True), 0);
end;

It works though but I have to change the TRichEdit's text after these settings to get the it detect the URLs in already written text. And that's the problem because my TRichEdit is in ReadOnly mode when applying this feature.

What should I do after performing this code to force the TRichEdit to detect URLs in already written text ?
I was looking at the documentation but there's no mention about something like this.

Thank you

Keine korrekte Lösung

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top