<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="https://syndication.webwiz.net/rss_namespace/">
 <channel>
  <title>Codejock Developer Community : ToolTipContxt for items in CTreeCtrl</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Toolkit Pro : ToolTipContxt for items in CTreeCtrl]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Tue, 09 Jun 2026 13:10:01 +0000</pubDate>
  <lastBuildDate>Thu, 03 Jan 2008 04:58:29 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_post_feed.asp?TID=9133</WebWizForums:feedURL>
  <image>
   <title><![CDATA[Codejock Developer Community]]></title>
   <url>http://forum.codejock.com/forum_images/codejock-logo.gif</url>
   <link>http://forum.codejock.com/</link>
  </image>
  <item>
   <title><![CDATA[ToolTipContxt for items in CTreeCtrl : For God&amp;#039;s sake! Solved it...  I...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=9133&amp;PID=29850&amp;title=tooltipcontxt-for-items-in-ctreectrl#29850</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2198">znakeeye</a><br /><strong>Subject:</strong> 9133<br /><strong>Posted:</strong> 03 January 2008 at 4:58am<br /><br />For God's sake! Solved it...<DIV>&nbsp;</DIV><DIV>I had removed "const" from the <FONT color=#020002 size=2>OnToolHitTest declaration, due to a call to&nbsp;the non-const function CancelToolTips()...</FONT></DIV><DIV><FONT color=#020002 size=2></FONT>&nbsp;</DIV><DIV><FONT color=#020002 size=2>I had a feeling long ago, but I ignored it until now. Thanks for your code. I believe I can use it here.</FONT></DIV>]]>
   </description>
   <pubDate>Thu, 03 Jan 2008 04:58:29 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=9133&amp;PID=29850&amp;title=tooltipcontxt-for-items-in-ctreectrl#29850</guid>
  </item> 
  <item>
   <title><![CDATA[ToolTipContxt for items in CTreeCtrl : Thanks for your response. Though,...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=9133&amp;PID=29834&amp;title=tooltipcontxt-for-items-in-ctreectrl#29834</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2198">znakeeye</a><br /><strong>Subject:</strong> 9133<br /><strong>Posted:</strong> 02 January 2008 at 4:06am<br /><br /><DIV>Thanks for your response. Though, I can't get it working here. OnToolHitTest and OnToolTipText are never called <img src="http://forum.codejock.com/smileys/smiley13.gif" border="0"></DIV><DIV>&nbsp;</DIV><DIV>Here is my WM_MOUSEMOVE trap:</DIV><DIV>&nbsp;</DIV><DIV>BOOL CMyTreeCtrl::OnWndMsg(UINT message, WPARAM wParam, LPARAM lParam, LRESULT *pResult)<BR>{<BR>&nbsp;if (message == WM_MOUSEMOVE)<BR>&nbsp;&nbsp;RelayEvent(message, wParam, lParam);<BR>...</DIV><DIV>}</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Wed, 02 Jan 2008 04:06:42 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=9133&amp;PID=29834&amp;title=tooltipcontxt-for-items-in-ctreectrl#29834</guid>
  </item> 
  <item>
   <title><![CDATA[ToolTipContxt for items in CTreeCtrl : Unfortunately CJ does not provide...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=9133&amp;PID=29619&amp;title=tooltipcontxt-for-items-in-ctreectrl#29619</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3213">rdhd</a><br /><strong>Subject:</strong> 9133<br /><strong>Posted:</strong> 19 December 2007 at 2:29pm<br /><br />Unfortunately CJ does not provide a tooltip control that is subclassed from the MFC tooltip control. Otherwise one could just call SetToolTips and pass in the pointer to a subclassed control. So its a bit harder to do but can be done.<DIV>&nbsp;</DIV><DIV>First call CTreeCtrl's SetToolTips(NULL) - that turns off the MFC tooltips in the CTreeCtrl (which if I remember correct codejock does subclass CXTTreeCtrl from).</DIV><DIV>&nbsp;</DIV><DIV>Then you have to relay mouse messages to the context using <FONT size=2>the CJ context's FilterToolTipMessage method (if you relay the mouse event from a handler you have to convert from client to screen). That goes something like this (I subclassed CTreeCtrl to get the mouse messages and implemented a "RelayEvent" method where I pass in <FONT size=2>e.g., WM_MOUSEMOVE as the first arg</FONT>):</FONT></DIV><DIV><FONT size=2><FONT color=#0000ff size=2><P>void</FONT><FONT size=2> MyListCtrl</FONT><FONT color=#0000ff size=2>::</FONT><FONT size=2>RelayEvent</FONT><FONT color=#0000ff size=2>(</FONT><FONT size=2>UINT message</FONT><FONT color=#0000ff size=2>,</FONT><FONT size=2> WPARAM wParam</FONT><FONT color=#0000ff size=2>,</FONT><FONT size=2> LPARAM lParam</FONT><FONT color=#0000ff size=2>)</P><P>{</P></FONT></FONT></DIV><FONT size=2><P>MSG msg</FONT><FONT color=#0000ff size=2>;</P></FONT><FONT size=2><P>msg</FONT><FONT color=#0000ff size=2>.</FONT><FONT size=2>hwnd</FONT><FONT color=#0000ff size=2>=</FONT><FONT size=2> m_hWnd</FONT><FONT color=#0000ff size=2>;</P></FONT><FONT size=2><P>msg</FONT><FONT color=#0000ff size=2>.</FONT><FONT size=2>message</FONT><FONT color=#0000ff size=2>=</FONT><FONT size=2> message</FONT><FONT color=#0000ff size=2>;</P></FONT><FONT size=2><P>msg</FONT><FONT color=#0000ff size=2>.</FONT><FONT size=2>wParam</FONT><FONT color=#0000ff size=2>=</FONT><FONT size=2> wParam</FONT><FONT color=#0000ff size=2>;</P></FONT><FONT size=2><P>msg</FONT><FONT color=#0000ff size=2>.</FONT><FONT size=2>lParam</FONT><FONT color=#0000ff size=2>=</FONT><FONT size=2> lParam</FONT><FONT color=#0000ff size=2>;</P></FONT><FONT size=2><P>POINT pt</FONT><FONT color=#0000ff size=2>;</P></FONT><FONT size=2><P>pt</FONT><FONT color=#0000ff size=2>.</FONT><FONT size=2>x </FONT><FONT color=#0000ff size=2>=</FONT><FONT size=2> LOWORD </FONT><FONT color=#0000ff size=2>(</FONT><FONT size=2>lParam</FONT><FONT color=#0000ff size=2>);</P></FONT><FONT size=2><P>pt</FONT><FONT color=#0000ff size=2>.</FONT><FONT size=2>y </FONT><FONT color=#0000ff size=2>=</FONT><FONT size=2> HIWORD </FONT><FONT color=#0000ff size=2>(</FONT><FONT size=2>lParam</FONT><FONT color=#0000ff size=2>);</P></FONT><FONT size=2><P>ClientToScreen</FONT><FONT color=#0000ff size=2>(&amp;</FONT><FONT size=2>pt</FONT><FONT color=#0000ff size=2>);</P></FONT><FONT size=2><P>msg</FONT><FONT color=#0000ff size=2>.</FONT><FONT size=2>time</FONT><FONT color=#0000ff size=2>=</FONT><FONT size=2> clock</FONT><FONT color=#0000ff size=2>();</P></FONT><FONT size=2><P>msg</FONT><FONT color=#0000ff size=2>.</FONT><FONT size=2>pt</FONT><FONT color=#0000ff size=2>.</FONT><FONT size=2>x</FONT><FONT color=#0000ff size=2>=</FONT><FONT size=2> pt</FONT><FONT color=#0000ff size=2>.</FONT><FONT size=2>x</FONT><FONT color=#0000ff size=2>;</P></FONT><FONT size=2><P>msg</FONT><FONT color=#0000ff size=2>.</FONT><FONT size=2>pt</FONT><FONT color=#0000ff size=2>.</FONT><FONT size=2>y</FONT><FONT color=#0000ff size=2>=</FONT><FONT size=2> pt</FONT><FONT color=#0000ff size=2>.</FONT><FONT size=2>y</FONT><FONT color=#0000ff size=2>;</P></FONT><FONT size=2><P></P><P>m_ToolTipContext</FONT><FONT color=#0000ff size=2>.</FONT><FONT size=2>FilterToolTipMessage</FONT><FONT color=#0000ff size=2>(this,</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>&amp;</FONT><FONT size=2>msg<FONT color=#0000ff>)</FONT><FONT>;</P><P>}</P><DIV></DIV><DIV></DIV><P>Then you also need to implement OnToolHitTest and <FONT size=2>OnToolTipText (depending on how you want to supply the text - it can be supplied in the OnToolHitTest routine).</P><DIV></DIV><P>Make sure the ID you provide in OnToolHitTest changes with each cell or CJ won't ask for the text. I do something like this in OnToolHitTest:</P><DIV></DIV><FONT size=2><P>pTI</FONT><FONT color=#0000ff size=2>-&gt;</FONT><FONT size=2>rect </FONT><FONT color=#0000ff size=2>=</FONT><FONT size=2> rectCell</FONT><FONT color=#0000ff size=2>;</P></FONT><FONT size=2><P>pTI</FONT><FONT color=#0000ff size=2>-&gt;</FONT><FONT size=2>hwnd </FONT><FONT color=#0000ff size=2>=</FONT><FONT size=2> m_hWnd</FONT><FONT color=#0000ff size=2>;</P></FONT><FONT size=2><P>pTI</FONT><FONT color=#0000ff size=2>-&gt;</FONT><FONT size=2>uId </FONT><FONT color=#0000ff size=2>=</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>(</FONT><FONT size=2>UINT</FONT><FONT color=#0000ff size=2>)((</FONT><FONT size=2> nItem </FONT><FONT color=#0000ff size=2>&lt;&lt;</FONT><FONT size=2> </FONT><FONT color=#ff0000 size=2>10</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>)</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>+</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>(</FONT><FONT size=2>hi</FONT><FONT color=#0000ff size=2>.</FONT><FONT size=2>iSubItem </FONT><FONT color=#0000ff size=2>&amp;</FONT><FONT size=2> </FONT><FONT color=#ff0000 size=2>0x3ff</FONT><FONT color=#0000ff size=2>)</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>+</FONT><FONT size=2> </FONT><FONT color=#ff0000 size=2>1</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>);</P></FONT><FONT size=2><P>pTI</FONT><FONT color=#0000ff size=2>-&gt;</FONT><FONT size=2>lpszText </FONT><FONT color=#0000ff size=2>=</FONT><FONT size=2> LPSTR_TEXTCALLBACK</FONT><FONT color=#0000ff size=2>;</P></FONT></FONT></FONT></FONT>]]>
   </description>
   <pubDate>Wed, 19 Dec 2007 14:29:26 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=9133&amp;PID=29619&amp;title=tooltipcontxt-for-items-in-ctreectrl#29619</guid>
  </item> 
  <item>
   <title><![CDATA[ToolTipContxt for items in CTreeCtrl : I&amp;#039;m trying to display Office2007-styled...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=9133&amp;PID=29547&amp;title=tooltipcontxt-for-items-in-ctreectrl#29547</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=2198">znakeeye</a><br /><strong>Subject:</strong> 9133<br /><strong>Posted:</strong> 18 December 2007 at 7:21am<br /><br />I'm trying to display Office2007-styled tooltips for all items in my CXTTreeCtrl-derived class. This seems tricky! I found this piece of information, but I still can't get it to work: <a href="http://forum.codejock.com/forum_posts.asp?TID=8578&amp;KW=tree+tooltip" target="_blank">http://forum.codejock.com/forum_posts.asp?TID=8578&amp;KW=tree+tooltip</A><DIV></DIV><DIV></DIV><DIV></DIV><DIV></DIV><DIV></DIV><DIV>&nbsp;</DIV><DIV>Any ideas on how to accomplish this?</DIV>]]>
   </description>
   <pubDate>Tue, 18 Dec 2007 07:21:03 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=9133&amp;PID=29547&amp;title=tooltipcontxt-for-items-in-ctreectrl#29547</guid>
  </item> 
 </channel>
</rss>