<?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 : Accessing a Pane&#039;s Icon</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Docking Pane : Accessing a Pane&#039;s Icon]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Thu, 14 May 2026 01:58:22 +0000</pubDate>
  <lastBuildDate>Sat, 11 Jul 2009 16:31:19 +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=14699</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[Accessing a Pane&#039;s Icon : But I don&amp;#039;t think I want...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=14699&amp;PID=50876&amp;title=accessing-a-panes-icon#50876</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3003">mrmathis</a><br /><strong>Subject:</strong> 14699<br /><strong>Posted:</strong> 11 July 2009 at 4:31pm<br /><br />But I don't think I want to replace the old icon.&nbsp; Here's an example of my issue with doing so:&nbsp; Say I have a command "Smash*t" with ID 400 in my application.&nbsp; It has an icon, and appears on my ribbon somewhere.&nbsp; I also have a docking pane "FancyPane" with ID 400.&nbsp; <DIV>&nbsp;</DIV><DIV>(Aside: We can argue in hindsight whether using the same numbers was a good idea, but at the time those IDs&nbsp;evolved it wasn't perceived as any kind of an issue.&nbsp; They were two completely separate worlds.&nbsp; Those IDs have been published in my app for over 10 years - long before Codejock came into the picture.&nbsp; Changing them is not a good option.)&nbsp; </DIV><DIV>&nbsp;</DIV><DIV>For my pane switching, I just create a pick-a-pane&nbsp;popup menu on the fly whose IDs match all the panes enumerate by the pane manager.&nbsp; It doesn't matter that they also match commands in my system, since I'm tracking the menu myself, and when it terminates I have the pane ID I want to activate.&nbsp; Now, if I follow your suggestion, I'll replace icon 400 in the global image manager with the one from the pane, right?&nbsp; But won't that also affect the ribbon display of the unrelated Smash*t command?&nbsp; Would I be able to replace, track my menu, and then reinstate the original image to that index without anything affecting my ribbon display?</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Sat, 11 Jul 2009 16:31:19 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=14699&amp;PID=50876&amp;title=accessing-a-panes-icon#50876</guid>
  </item> 
  <item>
   <title><![CDATA[Accessing a Pane&#039;s Icon : Hi, Strange. My suggestion have...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=14699&amp;PID=50838&amp;title=accessing-a-panes-icon#50838</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 14699<br /><strong>Posted:</strong> 10 July 2009 at 6:25am<br /><br />Hi,<DIV>Strange. My suggestion have to work - it copis one image to another it doesn't depend on ID you have.</DIV><DIV><FONT face="Courier New"></FONT>&nbsp;</DIV><DIV><FONT face="Courier New">SetCustomIcon anyway is not good method for you&nbsp; - it saves all copies of icons untill application terminated. You need replace old icon instead.</FONT></DIV>]]>
   </description>
   <pubDate>Fri, 10 Jul 2009 06:25:28 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=14699&amp;PID=50838&amp;title=accessing-a-panes-icon#50838</guid>
  </item> 
  <item>
   <title><![CDATA[Accessing a Pane&#039;s Icon : As I tried to describe earlier,...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=14699&amp;PID=50811&amp;title=accessing-a-panes-icon#50811</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3003">mrmathis</a><br /><strong>Subject:</strong> 14699<br /><strong>Posted:</strong> 09 July 2009 at 12:10pm<br /><br />As I tried to describe earlier, my docking pane IDs space is distinct from my command ID space, so I never add the pane icons to the&nbsp;global image manager.&nbsp; &nbsp;Therefore, your suggestion won't work for me.&nbsp; I've tried one other approach...<DIV>&nbsp;</DIV><DIV><FONT face="Courier New, Courier, mono">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (CXTPImageManagerIcon* pIcon = pPaneManager-&gt;GetIcon(nID))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CXTPImageManagerIconHandle&amp; refIcon = pIcon-&gt;GetIcon();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (HBITMAP hBitmap = refIcon.GetBitmap())<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CBitmap bmpIcon;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bmpIcon.Attach(hBitmap);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; HICON hIcon = CXTPTransparentBitmap(bmpIcon).ConvertToIcon();<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CXTPImageManagerIconHandle hIconHandle;&nbsp; // do not set equal to hIcon here or it will NOT destroy the icon<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hIconHandle = hIcon; // Will call DestroyIcon;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pControl-&gt;SetCustomIcon((HICON)hIconHandle);<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR></FONT></DIV><DIV>&nbsp;</DIV><DIV>...but that isn't going well either.&nbsp; First I get an assertion from CXTPImageManagerIconHandle::GetBitmap because the IsAlpha is false, then it hoses up the pane images on the screen and crashes shortly thereafter.&nbsp; I copied that central block from a co-worker and I'm not sure it properly applies to this situation.&nbsp; Is there any way I can massage this into something workable?&nbsp; Is there any other way to get back a usable icon from the docking pane manager?</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Thu, 09 Jul 2009 12:10:04 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=14699&amp;PID=50811&amp;title=accessing-a-panes-icon#50811</guid>
  </item> 
  <item>
   <title><![CDATA[Accessing a Pane&#039;s Icon : Hi,  Yes, It was changed (see...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=14699&amp;PID=50772&amp;title=accessing-a-panes-icon#50772</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 14699<br /><strong>Posted:</strong> 08 July 2009 at 3:50am<br /><br />Hi,<DIV>&nbsp;</DIV><DIV>Yes, It was changed (see release notes)&nbsp; - now by deafult all icons located on single bitmap to save GDI handlers. and ((HICON)IconRef) can return NULL.</DIV><DIV>Think most easy solution now is instead pControl-&gt;SetCustomIcon((HICON)IconRef);</DIV><DIV>call </DIV><DIV>&nbsp;</DIV><DIV>pCommandBars-&gt;GetImageManager()-&gt;GetImage(nControlID)-&gt;Copy(pIMIcon) - it will copy and replace icon asociated with pControl.</DIV>]]>
   </description>
   <pubDate>Wed, 08 Jul 2009 03:50:40 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=14699&amp;PID=50772&amp;title=accessing-a-panes-icon#50772</guid>
  </item> 
  <item>
   <title><![CDATA[Accessing a Pane&#039;s Icon : In my app, Ihavea drop menu that...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=14699&amp;PID=50746&amp;title=accessing-a-panes-icon#50746</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3003">mrmathis</a><br /><strong>Subject:</strong> 14699<br /><strong>Posted:</strong> 07 July 2009 at 12:49pm<br /><br /><P>In my app, I&nbsp;have&nbsp;a drop menu that allows selection of all the available docking panes.&nbsp; Functionally, it is identical to the menu available in Visual Studio that lets you switch between source files.&nbsp; Y'know, the little triangle icon with the bar over the top.&nbsp; Anyway, I used the&nbsp;block of code below with Codejock 11.2 to set the icons on the CXTPPopupBar entries that represent each pane.&nbsp; </P><DIV>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (CXTPImageManagerIcon* pIMIcon = pPane-&gt;GetIcon())<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (CXTPImageManagerIconHandle&amp; IconRef = pIMIcon-&gt;GetIcon())<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if ((HICON)IconRef)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pControl-&gt;SetCustomIcon((HICON)IconRef);<BR></DIV><DIV>This doesn't work in Codejock 13.0.&nbsp; I've debugged enough to see that the difference is in CXTPImageManagerIconSet::GetIcon, where the pIcon that is returned doesn't have the m_hIcon set in 13.&nbsp; I tried stepping into the display of the tab in 13 to see how it finds the icon.&nbsp; I can see it using m_pRInfo, but I'm not sure whether or how to access that myself.</DIV><DIV>&nbsp;</DIV><DIV>A couple of notes:&nbsp; I extract the icons&nbsp;from the pane in this way because 3rd party apps can add panes to my app and I don't have a master image list of all the possible icons.&nbsp; My pane IDs exist in a separate space from the rest of my images, and combining them isn't a viable option because of the 3rd party option, as well as some legacy issues in my own app, so I can't just fall back on the standard image lookup.</DIV><DIV>&nbsp;</DIV><DIV>Any solutions?</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Tue, 07 Jul 2009 12:49:25 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=14699&amp;PID=50746&amp;title=accessing-a-panes-icon#50746</guid>
  </item> 
 </channel>
</rss>