{"id":144,"date":"2006-12-17T20:27:09","date_gmt":"2006-12-17T18:27:09","guid":{"rendered":"https:\/\/alax.info\/blog\/144"},"modified":"2006-12-17T20:27:09","modified_gmt":"2006-12-17T18:27:09","slug":"chyperstatic-a-hypertext-static-control-in-atl-and-wtl","status":"publish","type":"post","link":"https:\/\/alax.info\/blog\/144","title":{"rendered":"CHyperStatic: a hypertext static control in ATL and WTL"},"content":{"rendered":"<p>As well known, <a href=\"http:\/\/wtl.sf.net\">WTL<\/a> provides <a href=\"http:\/\/www.codeproject.com\/wtl\/wtldocs2\/class_chyperlinkimpl.asp\">CHyperLinkImpl<\/a> custom control implementation to use clickable hyperlink controls. Also control uses a few styles (underlining, tags, command vs. notify notifications), the main implementation is limited:<\/p>\n<ul>\n<li>control frequently requires static text, tooltip text and location for <a href=\"http:\/\/msdn2.microsoft.com\/en-us\/library\/ms647732.aspx\">ShellExecute<\/a>; you cannot embed all three strings into dialog template control&#8217;s window text so you need an additional resource strings separated from the control definition<\/li>\n<li>you cannot have two or more links per control<\/li>\n<li>you can mix clickable text with unclickable, however this style is underimplemented: text wrap is not supported<\/li>\n<\/ul>\n<p>So, <em>CHyperLinkImpl<\/em> is great when you have nothing, but you are likely to still want more. Here goes more.<\/p>\n<p><img decoding=\"async\" alt=\"17-image001.png\" id=\"image141\" src=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2006\/12\/17-image001.png\" \/><\/p>\n<p><!--more--><\/p>\n<p><em>CHyperStatic<\/em> class implements a custom control with possibly multiple anchors, support for A tag with ID, HREF and TITLE atributes:<\/p>\n<ul>\n<li>ID value allows to identify clicked anchor in <a href=\"http:\/\/msdn.microsoft.com\/library\/en-us\/shellcc\/platform\/commctls\/common\/messages\/wm_notify.asp?frame=true\">WM_NOTIFY<\/a> notification<\/li>\n<li>HREF value is a placeholder for <em>ShellExecute<\/em> argument; the control may call it automatically or you have an option to cancel this behavior in a notification callback<\/li>\n<li>TITLE value defines tooltip text<\/li>\n<\/ul>\n<p>The control does supports multiline wrapping.<br \/>\nNote for &#8220;WTL without ATL&#8221; development: the implementation is dependent on ATL in <em>CAtlArray<\/em> class (atlcoll.h, may be reworked using <em>CSimpleArray<\/em>) and ATL regular expressions (atlrx.h, may be reworked using trivial string parsing).<br \/>\nVisual C++.NET 2005 source code can be downloaded <a title=\"scrollingpropertypage01.zip\" id=\"p113\" href=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2006\/12\/hyperstaticcontrol.zip\">here<\/a>, compiled binary &#8211; <a id=\"p114\" href=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2006\/12\/hyperstaticcontrolexe.zip\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As well known, WTL provides CHyperLinkImpl custom control implementation to use clickable hyperlink controls. Also control uses a few styles (underlining, tags, command vs. notify notifications), the main implementation is limited: control frequently requires static text, tooltip text and location for ShellExecute; you cannot embed all three strings into dialog template control&#8217;s window text so&hellip; <\/p>\n<p><a class=\"moretag\" href=\"https:\/\/alax.info\/blog\/144\">Read the full article<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,13,20],"tags":[],"class_list":["post-144","post","type-post","status-publish","format-standard","hentry","category-atl","category-source","category-wtl"],"_links":{"self":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/144","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/comments?post=144"}],"version-history":[{"count":0,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/144\/revisions"}],"wp:attachment":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/media?parent=144"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/categories?post=144"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/tags?post=144"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}