<?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 : No right-click notify for CXTPTreeBase</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Toolkit Pro : No right-click notify for CXTPTreeBase]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 15 Apr 2026 00:04:07 +0000</pubDate>
  <lastBuildDate>Mon, 20 Sep 2021 16:19:16 +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=24213</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[No right-click notify for CXTPTreeBase : For the record, Codejock&amp;#039;s...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=24213&amp;PID=78248&amp;title=no-rightclick-notify-for-cxtptreebase#78248</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=9498">xsensordev</a><br /><strong>Subject:</strong> 24213<br /><strong>Posted:</strong> 20 September 2021 at 4:19pm<br /><br /><div><div>For the record, Codejock's commented out notify code in CXTPTreeBase doesn't work because the m_pTreeCtrl is owned by the CXTPTreeBase derived control and not the window on which the control is placed.</div><div><br></div><div>However this works:</div><div><table width="99%"><tr><td><pre class="BBcode"></div><div>void CXTPTreeBase::OnRButtonDown(UINT /*nFlags*/, CPoint point)</div></div><div>{</div><div>&nbsp; &nbsp; if (m_pTreeCtrl-&gt;GetStyle() &amp; TVS_SINGLEEXPAND)</div><div>&nbsp; &nbsp; {</div><div>&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;m_pTreeCtrl-&gt;Default();</div><div>&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;return;</div><div>&nbsp; &nbsp; }</div><div><br></div><div>&nbsp; &nbsp; // hittest to get the tree item under the cursor</div><div>&nbsp; &nbsp; // and select it.</div><div>&nbsp; &nbsp; UINT uFlags<span style="white-space:pre">		</span>= 0;</div><div>&nbsp; &nbsp; HTREEITEM hItem = m_pTreeCtrl-&gt;HitTest(point, &amp;uFlags);</div><div>&nbsp; &nbsp; if (hItem != NULL &amp;&amp; (uFlags &amp; TVHT_ONITEM) != 0)</div><div>&nbsp; &nbsp; {</div><div>&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;// if the item is not selected, clear previous</div><div>&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;// selections and select the item under cursor.</div><div>&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;if (!IsSelected(hItem))</div><div>&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;{</div><div>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;SelectAll(FALSE);</div><div>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;SelectItem(hItem);</div><div>&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;}</div><div>&nbsp; &nbsp; }</div><div>&nbsp; &nbsp; else</div><div>&nbsp; &nbsp; {</div><div>&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;// clear previous selections.</div><div>&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;SelectAll(FALSE);</div><div>&nbsp; &nbsp; }</div><div><br></div><div>&nbsp; &nbsp; // call Default() so correct notification messages are</div><div>&nbsp; &nbsp; // sent such as TVN_BEGINRDRAG.</div><div>&nbsp; &nbsp; m_pTreeCtrl-&gt;Default();</div><div><br></div><div><div>&nbsp; &nbsp; CWnd* pParent = m_pTreeCtrl-&gt;GetOwner();</div><div>&nbsp; &nbsp; CWnd* pGrandParent = (pParent != NULL) ? pParent-&gt;GetOwner() : NULL;</div><div><br></div><div>&nbsp; &nbsp; HWND hWnd = (pGrandParent != NULL) ? pGrandParent-&gt;m_hWnd : NULL;</div><div><br></div><div>&nbsp; &nbsp; if (::IsWindow(hWnd))</div><div>&nbsp; &nbsp; {</div><div>&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;// construct a NMHDR struct...</div><div>&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;NMHDR mHDR;</div><div>&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;mHDR.hwndFrom = pParent-&gt;m_hWnd;</div><div>&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;mHDR.code = NM_RCLICK;</div><div>&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;mHDR.idFrom = m_pTreeCtrl-&gt;GetDlgCtrlID();</div><div><br></div><div>&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;// and send a WM_NOTIFY message to our owner.</div><div>&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;SendNotify(&amp;mHDR);</div><div>&nbsp; &nbsp; }</div></div><div>}</div><div></pre></td></tr></table></div>]]>
   </description>
   <pubDate>Mon, 20 Sep 2021 16:19:16 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=24213&amp;PID=78248&amp;title=no-rightclick-notify-for-cxtptreebase#78248</guid>
  </item> 
  <item>
   <title><![CDATA[No right-click notify for CXTPTreeBase : Toolkit Pro 20.0.0I&amp;#039;m not...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=24213&amp;PID=78247&amp;title=no-rightclick-notify-for-cxtptreebase#78247</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=9498">xsensordev</a><br /><strong>Subject:</strong> 24213<br /><strong>Posted:</strong> 20 September 2021 at 2:19pm<br /><br /><div>Toolkit Pro 20.0.0</div><div><br></div><div>I'm not able to receive a right-click event (used for context menu purposes) with any&nbsp;CXTPTreeBase derived tree controls.&nbsp; The CXTPTreeBase::OnRButtonDown handler in XTPTreeBase.cpp comments out the NM_RCLICK notification.&nbsp;&nbsp;<br><br>I can put this back in for my copy of Toolkit Pro, but its not clear as to why it was removed in the first place.</div>]]>
   </description>
   <pubDate>Mon, 20 Sep 2021 14:19:38 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=24213&amp;PID=78247&amp;title=no-rightclick-notify-for-cxtptreebase#78247</guid>
  </item> 
 </channel>
</rss>