Custom Text Hyperlinks in Richedit Control

Posted on 2004-11-21
Last Modified: 2010-04-24
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 "" 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!

Question by:oskard1
    LVL 55

    Expert Comment

    by:Jaime Olivares
    You can use an HTML control instead, it will offer you all the features of a browser including scripting.
    LVL 55

    Accepted Solution


    Author Comment

    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.,
    LVL 55

    Expert Comment

    by:Jaime Olivares
    >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.

    Author Comment

    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!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    The following diagram presents a diamond class hierarchy: As depicted, diamond inheritance denotes when two classes (e.g., CDerived1 and CDerived2), separately extending a common base class (e.g., CBase), are sub classed simultaneously by a fourt…
    In Easy String Encryption Using CryptoAPI in C++ ( I described how to encrypt text and recommended that the encrypted text be stored as a series of hexadecimal digits -- because cyphertext may…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now