Link to home
Start Free TrialLog in
Avatar of oskard1
oskard1

asked on

Custom Text Hyperlinks in Richedit Control

Hope this is in the right channel.

I'm creating a console based program, but I'd like the console to have some advanced features, such as displaying hyperlinks.  Richedit will currently support hyperlinks formatted as "http://www.example.com" or "file://c:\example.txt".  I'd like to have hyperlinks that don't use the reference as the link's display text.  Instead, it can just say "Click here", kind of like HTML.  Basically I'm looking for an equivalent to:
<a href="myprogram://id?12345">View Log</a>
but compatible with a richedit control.  Also, the link WON'T just be sent to the windows Shell.  The actual HREF will be handled internally by the program, so in my case, I'd be using an ID or something similar.

Should I even be using rich edit?  Anyone hear of a class that handles all this?  Not entirely urgent, but the quicker the better!

-Oskard
Avatar of Jaime Olivares
Jaime Olivares
Flag of Peru image

You can use an HTML control instead, it will offer you all the features of a browser including scripting.
ASKER CERTIFIED SOLUTION
Avatar of Jaime Olivares
Jaime Olivares
Flag of Peru image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of oskard1
oskard1

ASKER

Awesome, great, Much appreciated.
Do you know how good this thing is with resources?  Is it stable?  I like the examples they give, I've often wanted to replicate Norton Antivirus Web Interface, but do we really know that this is how they went about implementing it?

The program is meant to be a small server, so I'd rather not require a larger amount of resources than necessary... The idea of scripting... relying on Microsoft's scripting services just kinda bugs me.

But good answer, I hadn't thought of this one!

-James Wilson Tyrrell Jr.,
>Do you know how good this thing is with resources?
What do yo mean with resources? bitmaps? Anyway it will be stable depending on the HTML code you insert into controls, really CHtmlView is a Internet Explorer wrapper, so you have all the functionality.

>The idea of scripting... relying on Microsoft's scripting services just kinda bugs me.
Don't have to be VBScript, it could be JavaScript, for some interesting visual effects or validation of your Web interface.
Avatar of oskard1

ASKER

I just don't like the idea of putting an Internet Explorer component into my program, it seems clunky.  The sample program for SimpleBrowserForm takes up 8mb's of resources when loaded.  It seems like a lot, but a similar app with only a RichEdit box takes up 9 mb's.  That's basically what I meant, and in this case it looks like your idea is better.  I really appreciate the advice, thanks again!