<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head>
<title>CodeProject: CHyperLink: a simple MFC HyperLink button class
with any size 32bpp icons support. Free source code and programming help</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="Description" content="A class which encapsulates a hyperlink control for web page redirection or normal button usage.; Author: Gladstone; Section: Button Controls; Chapter: Desktop Development">
<meta name="Keywords" content="VC6, NT4, VS6, MFC, Dev, Intermediate,Button Controls,Desktop Development,Free source code, tutorials">
<meta name="Author" content="The Code Project">
<meta name="Rating" content="General">
<meta name="Robots" content="index, follow">
<meta name="Revisit-After" content="1 days">
<link rel="alternate" type="application/rss+xml" title="CodeProject Latest articles - All topics" href="http://www.codeproject.com/webservices/articlerss.aspx?cat=1">
<link rel="alternate" type="application/rss+xml" title="CodeProject Latest articles - MFC / C++" href="http://www.codeproject.com/webservices/articlerss.aspx?cat=2">
<link rel="alternate" type="application/rss+xml" title="CodeProject Latest articles - C#" href="http://www.codeproject.com/webservices/articlerss.aspx?cat=3">
<link rel="alternate" type="application/rss+xml" title="CodeProject Latest articles - ASP.NET" href="http://www.codeproject.com/webservices/articlerss.aspx?cat=4">
<link rel="alternate" type="application/rss+xml" title="CodeProject Latest articles - .NET" href="http://www.codeproject.com/webservices/articlerss.aspx?cat=5">
<link rel="alternate" type="application/rss+xml" title="CodeProject Latest articles - VB.NET" href="http://www.codeproject.com/webservices/articlerss.aspx?cat=6">
<link rel="alternate" type="application/rss+xml" title="CodeProject Lounge Postings" href="http://www.codeproject.com/webservices/LoungeRSS.aspx">
<link rel="search" type="application/opensearchdescription+xml" title="CodeProject" href="http://www.codeproject.com/info/OpenSearch.xml">
<link rel="stylesheet" type="text/css" href="HyperLink.aspx_files/CodeProject.css">
<link rel="stylesheet" type="text/css" href="HyperLink.aspx_files/ForumClassic.css">
<!-- base -->
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script><script src="HyperLink.aspx_files/ga.js" type="text/javascript"></script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-1735123-1");
pageTracker._setDomainName("www.codeproject.com");
pageTracker._setSessionTimeout("1200"); // 20 mins
pageTracker._initData();
pageTracker._trackPageview();
</script>
<script type="text/javascript" language="Javascript">//<![CDATA[
if(top!=self)top.location.href=location.href; if(typeof(DemoUrl)!="undefined")document.write(unescape('%3Cme')+'ta http'+'-equiv="re' +'fresh" con'+'tent="1;url='+DemoUrl+unescape('"%3CE'));
//]]></script>
<script type="text/javascript" language="Javascript" src="HyperLink.aspx_files/oncopy.js"></script>
<script type="text/javascript" language="Javascript" src="HyperLink.aspx_files/jxs.js"></script>
<script type="text/javascript" language="Javascript" src="HyperLink.aspx_files/bookmark.js"></script>
<script type="text/javascript" language="Javascript" src="HyperLink.aspx_files/rateitem.js"></script>
<script type="text/javascript" language="Javascript">//<![CDATA[
function ToggleMenu(itemName)
{
var elm = document.getElementById(itemName);
var i,others = document.getElementById('SectionMenu');
for(i=0; i < others.childNodes.length; i++)
{
var other = others.childNodes[i];
if ((other.className == 'MenuSectionBlock') && (other != elm))
other.style.display='none';
}
if (elm.style.display == 'block') elm.style.display='none';
else elm.style.display='block';
return false;
}
//]]></script>
<script type="text/javascript" language="Javascript" src="HyperLink.aspx_files/addto.js"></script>
<script type="text/javascript" language="Javascript">//<![CDATA[
function MarkAns(MemberID,MsgID,QID) {
document.write(unescape("%3Cdiv class=\"CallOut\"%3E"));
document.write("Was this a good answer to your question? ");
document.write(unescape("%3Ca href=\"#xx" + MsgID.toString() + "xx\" "));
document.write("onclick=\"RateMsg("+MemberID.toString()+", "+MsgID.toString()+",6,"+QID.toString()+");\"");
document.write(unescape("%3E"));
document.write(unescape("%3Cimg height=\"20\" width=\"20\" src=\"/script/Forums/Images/good.png\" alt=\"correct\" border=\"0\" align=\"absmiddle\" /%3E Yes%3C/a%3E"));
document.write(unescape("%3Ca href=\"#xx" + MsgID.toString() + "xx\" "));
document.write("onclick=\"RateMsg("+MemberID.toString()+","+MsgID.toString()+",7,"+QID.toString()+");\"");
document.write(unescape("%3E"));
document.write(unescape("%3Cimg height=\"20\" width=\"20\" src=\"/script/Forums/Images/bad.png\" alt=\"correct\" style=\"margin-left:10px\" border=\"0\" align=\"absmiddle\" /%3E No%3C/a%3E"));
document.write(unescape("%3C/div%3E"));
}
function MsgVFrm(MemberID,MsgID,GB,gp,bp,mt){
if(!GB)document.write("Rate this message: ");
document.write(unescape("%3Ca href=\"#xx" + MsgID.toString() + "xx\" onclick=\"RateMsg(" + MemberID.toString() + ", " + MsgID.toString() + ","));document.write((GB?"5":"1")+unescape(",0);\"%3E"));
if(GB) document.write(unescape("%3Cimg height=\"20\" width=\"20\" src=\"/script/Forums/Images/good.png\" alt=\"good\" border=\"0\" align=\"absmiddle\" /%3E "+gp+" "+mt+"%3C/a%3E "));
else document.write(unescape("%3Cimg height=\"14\" width=\"14\" src=\"/script/Forums/Images/thumbs_down.gif\" alt=\"vote 1\" border=\"0\" align=\"middle\" /%3E%3C/a%3E "));
if(GB)document.write(" "); else for(var i=1; i<=5;i++)
document.write(unescape("%3Ca class=\"Frm_MHL\" href=\"#xx" + MsgID.toString() + "xx\" title=\"vote this message a " + i.toString() + "\" onclick=\"RateMsg(" + MemberID.toString() + ", " + MsgID.toString() + ", " + i.toString() + ",0)\"%3E%3Cb%3E" + i.toString() + "%3C/b%3E%3C/a%3E "));
document.write(unescape("%3Ca href=\"#xx" + MsgID.toString() + "xx\" onclick=\"RateMsg(" + MemberID.toString() + ", " + MsgID.toString() + ","));document.write((GB?"1":"5")+unescape(",0);\"%3E"));
if(GB)document.write(unescape("%3Cimg height=\"20\" width=\"20\" src=\"/script/Forums/Images/bad.png\" alt=\"bad\" border=\"0\" align=\"absmiddle\" /%3E "+bp+" "+mt+"%3C/a%3E"));
else document.write(unescape("%3Cimg height=\"14\" width=\"14\" src=\"/script/Forums/Images/thumbs_up.gif\" border=\"0\" alt=\"vote 5\" align=\"middle\" /%3E%3C/a%3E "));
}
function ReportMsg(userid, msgid, score) {
if (confirm("Are you sure you want to report this message?"))
return RateMsg(userid, msgid, score, 0);
else return false;
}
function RateMsg(memberid, msgid, score, questionId) {
var req = new XMLHttpRequest();
req.onreadystatechange = function() {
if (req.readyState == 4){
if (req.status == 200){
var respText = req.responseText;
var re = new RegExp(unescape("\%3Cdiv\%3E([^\%3C]*)\%3C/div\%3E"), "g");
var match = re.exec(respText);
voteStatus.innerHTML = unescape("%3Cb%3E") + (match&&match[1])?match[1]:"An error occured" + unescape("%3C/b%3E");
} else
voteStatus.innerHTML = unescape("%3Cb style='color:red'%3EFailed!") + req.statusText + unescape("%3C/b%3E");
}
}
var voteStatus = document.getElementById("MVF" + msgid);
if (!voteStatus) return;
voteStatus.innerHTML = unescape("%3Cb style='color:green'%3EVoting...%3C/b%3E");
var strAction = "/script/Forums/Vote.aspx?js=1&fmid="+memberid.toString()+"&select="+msgid.toString()+"&score="+score.toString()+"&qid="+questionId.toString();
req.open("GET", strAct