![]() |
Desktop Development »
Miscellaneous »
General
Intermediate
License: The Code Project Open License (CPOL)
XHyperLink - yet another hyperlink controlBy Hans DietrichXHyperLink is a simple drop-in hyperlink control with optional parent notification. |
VC6Win2K, WinXP, Win2003, MFC, Dev
|
|
Advanced Search |
|
|
|
||||||||||||||||
For many years I have used Chris Maunder's excellent Hyperlink control. Recently I needed a hyperlink that would send a notification to the parent dialog. So I started by adding this feature, and then I found that I had added other features too. Here is a list of the new features:
IDC_HAND - the MFC hand cursor is used when it is available, before defaulting to the cursor from Winhelp.
GoToURL() is now static - now you can say CXHyperLink::GoToURL("http://www.somedomain.com").
XHYPERLINK_REPORT_ERROR define - by default this symbol is not defined, which will remove all the strings and message box from ReportError().
DestroyCursor(m_hLinkCursor) that was suggested by Geert Delmeiren. To integrate XHyperLink() into your app, you first need to add following files to your project:
Then use the resource editor to add a static control to your dialog, and use Class Wizard to attach a member variable to that control. Note that when adding the static control, you must name it something other than IDC_STATIC.
Next, include the header file XHyperLink.h in the dialog's header file. Then replace the CStatic definition with CXHyperLink. Now you are ready to start using XHyperLink.
The XHyperLinkTest.exe demo shows how to use CXHyperLink. The first hyperlink sends an email:

The next hyperlink sends a notification to the parent dialog:

and the dialog displays a message box:

The last hyperlink shows how the text and URL may be dynamically changed:

This software is released into the public domain. You are free to use it in any way you like. If you modify it or extend it, please to consider posting new code here for everyone to share. This software is provided "as is" with no expressed or implied warranty. I accept no liability for any damage or loss of business that this software may cause.
| You must Sign In to use this message board. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
General
News
Question
Answer
Joke
Rant
Admin
|
PermaLink |
Privacy |
Terms of Use
Last Updated: 16 Oct 2003 Editor: Smitha Vijayan |
Copyright 2003 by Hans Dietrich Everything else Copyright © CodeProject, 1999-2009 Web13 | Advertise on the Code Project |