Reputation: 1205
I am building a textEdit application with MFC. Is there a way to create a hyperlink automatically when a user write web address? It's like when you write a web address "www.google.com" the application detects web address and create a hyperlink right away. I have searched documents that explains about this, but couldn't find it.
Upvotes: 0
Views: 203
Reputation: 60001
You'll probably want to use the CRichEditCtrl, which uses the RTF spec to do rich text highlighting. This can include underline and colors, which you could use to create a hyperlink. See RTF syntax for hyperlink for more info.
I think you'll still have to detect clicking on that hyperlink, but that's perhaps a separate issue.
Be aware, Jake, that MFC is a bit of an outdated UI framework. If you know what you're doing and why you need to use it, great, but if you're just getting into UI programming, I'd suggest something more modern, like WPF or any of the XAML-based spin-offs.
Upvotes: 1