• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 448
  • Last Modified:

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
0
oskard1
Asked:
oskard1
  • 3
  • 2
1 Solution
 
Jaime OlivaresCommented:
You can use an HTML control instead, it will offer you all the features of a browser including scripting.
0
 
oskard1Author Commented:
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.,
0
 
Jaime OlivaresCommented:
>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.
0
 
oskard1Author Commented:
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!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now