Using Delphi's TRichEdit, is there a way to set up a "link" so someone can click it to open a file?

88 Views Asked by At

I'm doing a kind of grep in a Delphi app where the user can search some files in a folder for a search term. Then in a TRichEdit, for each file with a match, I'm showing a filename and below it I show lines that contain the search term.

I'd like to be able to have the filename act like a hotlink so if you click it, it will open the file in whatever the system default is. They're usually just text files, so I could also open them all in Notepad++.

I know this can be done in TRichView but I don't have access to it here. In RV, you can have any text look like a URL and when it's clicked you can do whatever you want with it. Last I checked, the regular RichEdit controls treat them only as web URLs and only let you route them to a web browser. Delphi has never done much to update lots of these standard Windows controls, and what's there isn't well documented. So I'm wondering if anybody knows this for sure.

In case it matters, I'm using Delphi 10.2.3 (Tokyo) on Windows 10.

0

There are 0 best solutions below