Simple Hyperlink Static Control

Environment: VC6 SP5

I referred to "CScrollHotStatic!XHyperlink and Scroll CStatic Class" by Zhibin Cao when I wrote this control. There are two public functions in CHyperlinkStatic:

void SetHyperlink(CString strHyperlink)
void SetCaption(CString strCaption)

SetHyperlink is used to set the hyperlink where you will surf if you click it. SetCaption is used to set the caption you will see.

When the cursor is over the caption, it will become a "Hand" cursor. The caption of the control is also underlined. Simple is the best. I don't have other information to talk about. Enjoy! :-)

Downloads

Download demo project - 21 Kb
Download source - 3 Kb


Comments

  • Some adds

    Posted by Legacy on 05/05/2003 12:00am

    Originally posted by: Mr. S

    If you would like to change the url and caption, for example to display different items from a database,
    
    change the SetCaption-method like this:

    void CHyperlinkStatic::SetCaption(CString strCaption)
    {
    _strCaption = strCaption;
    _bGetCaptionSize = false;
    SetWindowText(NULL);
    Invalidate();
    }

    Without SetWindowText(NULL) and Invalidate the class don't paint the changes.

    If you have some problems with IDC_HAND type this in HyperlinkStatic.h on top:

    #ifndef IDC_HAND
    #define IDC_HAND MAKEINTRESOURCE(32649)
    #endif

    Cu
    Mr. S

    Reply
  • More Hyperlinks

    Posted by Legacy on 01/15/2003 12:00am

    Originally posted by: Vitaly

    Just wanted to mention another VC++ HyperLink class that can be found on this website: http://www.tooltips.net

    Regards,
    Vitaly

    Reply
  • its nice but........

    Posted by Legacy on 01/12/2003 12:00am

    Originally posted by: roshan

    its nice proj. but there is some prob..........
    so plez handle the prob.

    Reply
  • Demo proj- resource file sharing violation

    Posted by Legacy on 01/10/2003 12:00am

    Originally posted by: Aras

    Great work
    but sorry i couldnt compile the Demo project.
    because of resource Error :
    HyperlinkDemo.rc(20) : fatal error RC4214: Codepage not valid: ignored
    Error executing rc.exe.

    I think the reason is chiness language in resource and may
    change it to:

    LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
    #pragma code_page(1252)

    thanks.

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Live Event Date: September 10, 2014 @ 11:00 a.m. ET / 8:00 a.m. PT Modern mobile applications connect systems-of-engagement (mobile apps) with systems-of-record (traditional IT) to deliver new and innovative business value. But the lifecycle for development of mobile apps is also new and different. Emerging trends in mobile development call for faster delivery of incremental features, coupled with feedback from the users of the app "in the wild". This loop of continuous delivery and continuous feedback is …

  • This ESG study by Mark Peters evaluated a common industry-standard disk VTl deduplication system (with 15:1 reduction ratio) versus a tape library with LTO-5, drives with full nightly backups, over a five-year period.  The scenarios included replicated systems and offsite tape vaults.  In all circumstances, the TCO for VTL with deduplication ranged from about 2 to 4 times more expensive than the LTO-5 tape library TCO. The paper shares recent ESG research and lots more. 

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds