<?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 : Context Menu images with CXTPCommandBars problem</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : Context Menu images with CXTPCommandBars problem]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Thu, 11 Jun 2026 08:42:45 +0000</pubDate>
  <lastBuildDate>Mon, 11 Aug 2008 11:24:48 +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=11771</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[Context Menu images with CXTPCommandBars problem : Thanks for your response.   I...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11771&amp;PID=39717&amp;title=context-menu-images-with-cxtpcommandbars-problem#39717</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4414">KJM-18</a><br /><strong>Subject:</strong> 11771<br /><strong>Posted:</strong> 11 August 2008 at 11:24am<br /><br /><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN lang=EN style="COLOR: black; FONT-FAMILY: Verdana; mso-ansi-: EN"><FONT size=2>Thanks for your response. <?:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></FONT></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN lang=EN style="COLOR: black; FONT-FAMILY: Verdana; mso-ansi-: EN"><FONT size=2>&nbsp;<o:p></o:p></FONT></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN lang=EN style="COLOR: black; FONT-FAMILY: Verdana; mso-ansi-: EN"><FONT size=2>I looked at that sample code&nbsp;however I still could not get my code to work.&nbsp; The SetIcons() function takes a toolbar resource ID and an image list, neither of which my example has. I need to assign different images to&nbsp;menu items at runtime and the images are bitmaps stored in the resource file.<o:p></o:p></FONT></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN lang=EN style="COLOR: black; FONT-FAMILY: Verdana; mso-ansi-: EN"><FONT size=2>&nbsp;<o:p></o:p></FONT></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN lang=EN style="COLOR: black; FONT-FAMILY: Verdana; mso-ansi-: EN"><FONT size=2>I'm new to working in C++ and would really appreciate it if you could modify the sample code I provided or show me a longer code snippet.<o:p></o:p></FONT></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN lang=EN style="COLOR: black; FONT-FAMILY: Verdana; mso-ansi-: EN"><FONT size=2>&nbsp;<o:p></o:p></FONT></SPAN></P><P =Ms&#111;normal style="MARGIN: 0in 0in 0pt"><SPAN lang=EN style="COLOR: black; FONT-FAMILY: Verdana; mso-ansi-: EN"><FONT size=2>Many thanks in advance.<o:p></o:p></FONT></SPAN></P>]]>
   </description>
   <pubDate>Mon, 11 Aug 2008 11:24:48 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11771&amp;PID=39717&amp;title=context-menu-images-with-cxtpcommandbars-problem#39717</guid>
  </item> 
  <item>
   <title><![CDATA[Context Menu images with CXTPCommandBars problem : Hello,  Instead of SetMenuItemBitmaps...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11771&amp;PID=39698&amp;title=context-menu-images-with-cxtpcommandbars-problem#39698</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 11771<br /><strong>Posted:</strong> 11 August 2008 at 2:34am<br /><br />Hello,<DIV>&nbsp;</DIV><DIV>Instead of SetMenuItemBitmaps&nbsp; add Images to ImageManager. See our CommandBarIcons .</DIV><DIV></DIV><DIV>&nbsp;</DIV><DIV>XTPImageManager()-&gt;SetIcons(...);</DIV>]]>
   </description>
   <pubDate>Mon, 11 Aug 2008 02:34:17 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11771&amp;PID=39698&amp;title=context-menu-images-with-cxtpcommandbars-problem#39698</guid>
  </item> 
  <item>
   <title><![CDATA[Context Menu images with CXTPCommandBars problem : Hi, I&#8217;m new to C++ and to using...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11771&amp;PID=39647&amp;title=context-menu-images-with-cxtpcommandbars-problem#39647</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4414">KJM-18</a><br /><strong>Subject:</strong> 11771<br /><strong>Posted:</strong> 08 August 2008 at 5:24pm<br /><br /><P><img src="https://forum.codejock.com/smileys/smiley5.gif" border="0">&nbsp;Hi, I’m new to C++ and to using Xtreme ToolkitPro (ver. 11.2.2). I’ve been trying to display bitmap images before the text of a dynamically created context menu popup. I can get it to work using just the standard Menu class, but can not get the images to display when using the CXTPCommandBars::TrackPopupMenu code (see below). I’ve looked at all the samples but none of them use dynamically created menus where the images are assigned at run-time. I must be missing a step or something&nbsp;and would appreciate any suggestions.</P><DIV>//// &nbsp;TEST CODE FOLLOWS<BR>//&nbsp;&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>void CTreeFormView::PopupEmptyPosition(CSingleOrg* DestSingleOrg, CPoint point, CString SourcePosnNbr, CString SourcePosnID, CString SourceSN, CString SourceMemId, CString SourcePosnOrgId, CString SourcePosnUIC, CString SourceFutureInd)<BR>{</DIV><P>&nbsp;CMenu popup;<BR>&nbsp;bool&nbsp; ShowPopup = false;<BR>&nbsp;CBitmap FirstBitmap, SecondBitmap;<BR>&nbsp;int i,x,y;<BR>&nbsp;CString string,prompt,title;<BR>&nbsp;CRect rect;<BR>&nbsp;<BR>&nbsp;// 2 different bitmap images<BR>&nbsp;FirstBitmap.LoadBitmap(IDB_BITMAP_1);<BR>&nbsp;SecondBitmap.LoadBitmap(IDB_BITMAP_2);</P><P>&nbsp;popup.CreatePopupMenu();</P><P>&nbsp;// Simple loop that creates 4 menu items <BR>&nbsp;// with the first 2 having the IDB_BITMAP_1 image<BR>&nbsp;// and the last 2 displaying the IDB_BITMAP_2 image before the text<BR>&nbsp;for (i = 0; i&lt;4; i++) {<BR>&nbsp;&nbsp;if(i &lt; 2){<BR>&nbsp;&nbsp;&nbsp;prompt = _T("Empty");<BR>&nbsp;&nbsp;&nbsp;popup.AppendMenu(MF_ENABLED|MF_STRING, ID_POPUP_MOVE_MEMBER1+i+1, prompt);<BR>&nbsp;&nbsp;&nbsp;popup.SetMenuItemBitmaps(i+1, MF_BYPOSITION, &amp;FirstBitmap, &amp;FirstBitmap);<BR>&nbsp;&nbsp;}<BR>&nbsp;&nbsp;else {<BR>&nbsp;&nbsp;&nbsp;prompt = _T("Full");<BR>&nbsp;&nbsp;&nbsp;popup.AppendMenu(MF_ENABLED|MF_STRING, ID_POPUP_MOVE_MEMBER1+i+1, prompt);<BR>&nbsp;&nbsp;&nbsp;popup.SetMenuItemBitmaps(i+1, MF_BYPOSITION, &amp;SecondBitmap, &amp;SecondBitmap);<BR>&nbsp;&nbsp;}<BR>&nbsp;}</P><P>&nbsp;GetWindowRect(&amp;rect);<BR>&nbsp;x = rect.left+point.x;<BR>&nbsp;y = rect.top+point.y;</P><P>&nbsp;// This is the original code that displays the images <BR>&nbsp;// before the text, but it does not have the look<BR>&nbsp;// of the CXTPCommandBars and we want to update it<BR>//&nbsp;popup.TrackPopupMenu (TPM_NONOTIFY| TPM_LEFTALIGN |TPM_RETURNCMD, x, y, this, NULL);<BR>&nbsp;<BR>&nbsp;// This is the new code that shows the context menu popup, <BR>&nbsp;// but does not show the bitmap images before the text<BR>&nbsp;CXTPCommandBars::TrackPopupMenu(&amp;popup, TPM_NONOTIFY| TPM_LEFTALIGN |TPM_RETURNCMD, x, y, this, NULL);</P><P>&nbsp;popup.DestroyMenu();</P><P>&nbsp;::DeleteObject(FirstBitmap);<BR>&nbsp;::DeleteObject(SecondBitmap);<BR>}<BR></P>]]>
   </description>
   <pubDate>Fri, 08 Aug 2008 17:24:49 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11771&amp;PID=39647&amp;title=context-menu-images-with-cxtpcommandbars-problem#39647</guid>
  </item> 
 </channel>
</rss>