Welcome to HLinkCtrl, A freeware MFC class that supports Internet Hyperlinks
from standard Windows applications just like they are displayed in Web browsers.

Included is a simple dialog based application which shows you how to use the class.

Basically all you need to do is associate a CStatic instance with the static you 
want to turn into a hyperlink using classwizard.

Then change the declaration of the variable from CStatic to CHLinkCtrl in your dialogs
header file.

In your dialogs OnInitDialog function call the SetHyperLink with the URL you want
to link to as follows:

BOOL CHLinkTestDlg::OnInitDialog()
{
  CDialog::OnInitDialog();

  m_ctrlWeb.SetHyperLink(_T("http://indigo.ie/~pjn"));
  
  return TRUE;
}

Now when you run the program you will notice that the icon changes to a hand when 
you move over the edit controls and when you click on the text the URL will be 
executed. You can also right click on the control to get a standard context menu.

The demo program shows how to link to web pages aswell as mailto 
links, in fact any URL such as "file://", "ftp://" etc can be used.

All the styles etc can be customized using the member functions provided. Some
of the features it includes are:

Context Menu
Properties dialog ala IE3
Add to Favorites & Desktop
Clipboard support



Some places I find this class very useful is to spruce up an otherwise plain about
box in your windows applications.


To use HLinkCtrl in your project simply include hlinkctrl.cpp from the test application 
in your application and #include hlinkctl.h in whatever modules what to use it. You 
will also need to include the following resource from hlinktest.rc into your rc file.

IDC_HLINK Cursor
IDD_HLINK_PROPERTIES dialog
IDI_HLINK_URL icon
IDR_HLINK_POPUP menu
All the contents of the single string table

You will also need to initialise the OLE libraries as the control makes use of a number 
of COM Interface. This can be done by placing a call to AfxOleInit in your apps 
InitInstance function.




Happy coding.


CONTACTING THE AUTHOR

PJ Naughter
Email: pjn@indigo.ie
Web: http://indigo.ie/~pjn
6th November 1997


