<?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 : Need help with TrackPopupMenu</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : Need help with TrackPopupMenu]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Thu, 11 Jun 2026 02:02:50 +0000</pubDate>
  <lastBuildDate>Thu, 24 Jan 2008 00:59:13 +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=9398</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[Need help with TrackPopupMenu : Hi,  There is ON_XTP_INITCOMMANDSPOPUP...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=9398&amp;PID=30455&amp;title=need-help-with-trackpopupmenu#30455</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 9398<br /><strong>Posted:</strong> 24 January 2008 at 12:59am<br /><br />Hi,<DIV>&nbsp;</DIV><DIV>There is ON_XTP_INITCOMMANDSPOPUP notification in ComamndBars. See \Samples\CommandBars\Notifications .</DIV><DIV>&nbsp;</DIV><DIV>To create isolated ImageManager call</DIV><DIV>&nbsp;</DIV><DIV>pCommandBars-&gt;SetImageManager(new CXTPImageManager()); - it this commandbars will use own images.</DIV>]]>
   </description>
   <pubDate>Thu, 24 Jan 2008 00:59:13 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=9398&amp;PID=30455&amp;title=need-help-with-trackpopupmenu#30455</guid>
  </item> 
  <item>
   <title><![CDATA[Need help with TrackPopupMenu : That&amp;#039;s the rub. I was using...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=9398&amp;PID=30444&amp;title=need-help-with-trackpopupmenu#30444</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3213">rdhd</a><br /><strong>Subject:</strong> 9398<br /><strong>Posted:</strong> 23 January 2008 at 3:56pm<br /><br />That's the rub. I was using CMenu::TrackPopupMenu and changed to use the CJ code. If I go thru the original code and set breakpoints in the CDialog::OnCmdMsg, no calls are made when I invoke CMenu::TrackPopupMenu.<DIV>&nbsp;</DIV><DIV>That is, CDialog::OnCmdMsg call is only made when I use the command bars class to track the menu.</DIV><DIV>&nbsp;</DIV><DIV>My experience with CMenu::TrackPopupMenu is that the tracking window gets a <FONT size=2>WM_INITMENUPOPUP message (as well as other menu messages like WM_MENUSELECT). When Windows sends the WM_INITPOPUPMENU message, we can spin thru the menu and enable/disable items, add bit maps etc (if we implement the handler that is). CJ does not seem to ever use that paradigm with its popup menu tracking. I believe this is the difference.</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>Some of our code prepares the menu before calling TrackPopupMenu. That is, instead of reacting to WM_INITMENUPOPUP, we load the menu from a resource file (or build it at runtime). We then enable/disable items and also add a bitmap to the menu using <FONT size=2>SetMenuItemBitmaps.</FONT></FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>By the way, instead of using the CJ frame window's command bars object, I created my own and set the site to the dialog box. I can change the code for each tracking object to resolve the OnCmdMsg problem. But I have another issue you did not comment on.</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>How do I prevent CJ from putting the (incorrect) icons on the popup menu?</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>The command bars object I created has no image manager but I called SetImageManager(NULL) to no avail (wrong bitmaps still appear).</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>Also, for what its worth, I can use the TPM_NONOTIFY message, which shuts down OnCmdMsg calls altogether. So between that flag and having dialogs and other windows implement OnCmdMsg, the icon issue is all that remains.</FONT></DIV>]]>
   </description>
   <pubDate>Wed, 23 Jan 2008 15:56:57 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=9398&amp;PID=30444&amp;title=need-help-with-trackpopupmenu#30444</guid>
  </item> 
  <item>
   <title><![CDATA[Need help with TrackPopupMenu : Hello,  problem not in TrackPopupMenu....]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=9398&amp;PID=30435&amp;title=need-help-with-trackpopupmenu#30435</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 9398<br /><strong>Posted:</strong> 23 January 2008 at 1:40pm<br /><br />Hello,<DIV>&nbsp;</DIV><DIV>problem not in TrackPopupMenu. I bet you will see same if will use standard TrakPopupMenu.</DIV><DIV>&nbsp;</DIV><DIV>Check code of CDialog::OnCmdMsg and you will understand.</DIV><DIV>solution is to override this method and don't call CDialog's version.</DIV><DIV>but I recommend clean up your Ids and don't use same values for dialog and frame.</DIV>]]>
   </description>
   <pubDate>Wed, 23 Jan 2008 13:40:48 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=9398&amp;PID=30435&amp;title=need-help-with-trackpopupmenu#30435</guid>
  </item> 
  <item>
   <title><![CDATA[Need help with TrackPopupMenu : I have a dialog box that wants...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=9398&amp;PID=30430&amp;title=need-help-with-trackpopupmenu#30430</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3213">rdhd</a><br /><strong>Subject:</strong> 9398<br /><strong>Posted:</strong> 23 January 2008 at 12:25pm<br /><br />I have a dialog box that wants to track a popup menu. The menu is specified in a menu resource so I use a CMenu to load the resource. Then I call <FONT size=2>CXTPCommandBars</FONT><FONT color=#0000ff size=2>::</FONT><FONT size=2>TrackPopupMenu.<DIV></DIV><DIV></DIV><DIV>&nbsp;</DIV><DIV>But I have a problem with where messages go. I can get the WM_COMMAND message to be directed to the dialog. However, the OnCmdMsg function is invoked on my main frame (probably because it owns the dialog).</DIV><DIV>&nbsp;</DIV><DIV>Also I am seeing icons being added to the popup menu that are incorrect because the dialog has its own command IDs on its menu and some of those IDs happen to be IDs used by the frame on its CXTPRibbonBar (incorrect tooltips are&nbsp;displayed too).</DIV><DIV>&nbsp;</DIV><DIV>I have tried both the static and non-static TrackPopupMenu functions. I have tried TrackPopupMenuEx. I have tried setting each CWnd* arg to the dialog and setting each to the dialog while the other&nbsp;I set to NULL. I have tried passing in the frame's command bars pointer as the last arg and NULL for that arg (for the static methods). I believe I have exhausted all the various combinations and still I cannot get the OnCmdMsg call from being made on my frame window.</DIV><DIV>&nbsp;</DIV><DIV>How do I get TrackPopupMenu or TrackPopupMenuEx to work correctly with the dialog?</DIV></FONT>]]>
   </description>
   <pubDate>Wed, 23 Jan 2008 12:25:41 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=9398&amp;PID=30430&amp;title=need-help-with-trackpopupmenu#30430</guid>
  </item> 
 </channel>
</rss>