<?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 : CXTPTabClientWnd tab change ic&#111;n</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Toolkit Pro : CXTPTabClientWnd tab change ic&#111;n]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sun, 05 Apr 2026 05:51:02 +0000</pubDate>
  <lastBuildDate>Wed, 29 Nov 2006 06:08:49 +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=2395</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[CXTPTabClientWnd tab change ic&#111;n : Hi,  think best place is OnInitialUpdate....]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=2395&amp;PID=17749&amp;title=cxtptabclientwnd-tab-change-icon#17749</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 2395<br /><strong>Posted:</strong> 29 November 2006 at 6:08am<br /><br />Hi,<DIV>&nbsp;</DIV><DIV>think best place is OnInitialUpdate.</DIV>]]>
   </description>
   <pubDate>Wed, 29 Nov 2006 06:08:49 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=2395&amp;PID=17749&amp;title=cxtptabclientwnd-tab-change-icon#17749</guid>
  </item> 
  <item>
   <title><![CDATA[CXTPTabClientWnd tab change ic&#111;n : Hi oleg,The icon I would like...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=2395&amp;PID=17741&amp;title=cxtptabclientwnd-tab-change-icon#17741</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1519">mailhaim</a><br /><strong>Subject:</strong> 2395<br /><strong>Posted:</strong> 29 November 2006 at 3:01am<br /><br />Hi oleg,<br>The icon I would like to use depnds on information that persist in the document.<br>What is the first place that the frame and document are attached?<br>I tried in OnCreateClient() but GetActiveDocument() returns NULL.  <br><br>Regards, Haim<br>]]>
   </description>
   <pubDate>Wed, 29 Nov 2006 03:01:30 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=2395&amp;PID=17741&amp;title=cxtptabclientwnd-tab-change-icon#17741</guid>
  </item> 
  <item>
   <title><![CDATA[CXTPTabClientWnd tab change ic&#111;n : If you don;&amp;#039;t need dynamically...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=2395&amp;PID=17695&amp;title=cxtptabclientwnd-tab-change-icon#17695</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 2395<br /><strong>Posted:</strong> 28 November 2006 at 7:55am<br /><br /><P>If you don;'t need dynamically change it you can create icon in constructor:</P><DIV>CChildFrame::CChildFrame()<BR>{<BR>m_hIconTab = AfxGetApp()-&gt;LoadIcon(IDR_MAINFRAME);<BR><BR>}</DIV><DIV>&nbsp;</DIV><DIV>and retrieve it:</DIV><DIV>&nbsp;</DIV><DIV>LRESULT CChildFrame::OnGetTabIcon(WPARAM, LPARAM)<BR>{<BR>&nbsp;&nbsp;&nbsp; return (LRESULT)m_hIconTab;<BR>} <BR></DIV>]]>
   </description>
   <pubDate>Tue, 28 Nov 2006 07:55:27 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=2395&amp;PID=17695&amp;title=cxtptabclientwnd-tab-change-icon#17695</guid>
  </item> 
  <item>
   <title><![CDATA[CXTPTabClientWnd tab change ic&#111;n : Hi Oleg,I&amp;#039;m not fully understand...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=2395&amp;PID=17694&amp;title=cxtptabclientwnd-tab-change-icon#17694</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1519">mailhaim</a><br /><strong>Subject:</strong> 2395<br /><strong>Posted:</strong> 28 November 2006 at 4:15am<br /><br />Hi Oleg,<br>I'm not fully understand what is the purpose of:<br>ON_COMMAND(ID_BACK, OnBack)<br>in order to fetch the tab icon and where ID_BACK defined?!<br><br>I took the OnBack and put it in OnGetTabIcon, as follows:<br>LRESULT CChildFrame::OnGetTabIcon(WPARAM, LPARAM)<br>{<br>&nbsp;&nbsp;&nbsp; HICON hIcon = AfxGetApp()-&gt;LoadIcon(IDR_MAINFRAME);<br>&nbsp;&nbsp;&nbsp; if( hIcon != NULL )<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; SetIcon(hIcon, FALSE);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; GetParentFrame()-&gt;RecalcLayout();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; return 0;<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; return ::SendMessage(m_hWnd, WM_GETICON, ICON_SMALL, 0);<br>} <br><br>The problem is this code is constantly get called.<br>What is the problem?<br>]]>
   </description>
   <pubDate>Tue, 28 Nov 2006 04:15:46 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=2395&amp;PID=17694&amp;title=cxtptabclientwnd-tab-change-icon#17694</guid>
  </item> 
  <item>
   <title><![CDATA[CXTPTabClientWnd tab change ic&#111;n : I got this working in the end....]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=2395&amp;PID=14480&amp;title=cxtptabclientwnd-tab-change-icon#14480</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1322">danpetitt</a><br /><strong>Subject:</strong> 2395<br /><strong>Posted:</strong> 31 July 2006 at 4:00am<br /><br />I got this working in the end. I had to derive a class from CSingleWorkspace and override the DrawIcon function so I could pass back/modify the icon size where and if appropriate.<DIV>&nbsp;</DIV><DIV>For those that would like this, here is the code:</DIV><DIV><table width="99%"><tr><td><pre class="BBcode">class CMyTabClientWnd : public CXTPTabClientWnd<BR>{<BR>public:<BR>&nbsp;class CMyWorkspace : public CXTPTabClientWnd::CSingleWorkspace<BR>&nbsp;{<BR>&nbsp;&nbsp;virtual BOOL DrawIcon(CDC* pDC, CPoint pt, CXTPTabManagerItem* pItem, BOOL bDraw, CSize&amp; szIcon) const<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;if (GetPaintManager()-&gt;m_bShowIcons == FALSE)<BR>&nbsp;&nbsp;&nbsp;&nbsp;return FALSE;</DIV><DIV>&nbsp;&nbsp;&nbsp;HICON hIcon = GetItemIcon( pItem );<BR>&nbsp;&nbsp;&nbsp;if( hIcon )<BR>&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;// We have an icon so lets set the size ... the cx/cy could be obtained from the icon but in this case I am only using one 8x8 icon so hardcoding is okay<BR>&nbsp;&nbsp;&nbsp;&nbsp;szIcon.cx = 8;<BR>&nbsp;&nbsp;&nbsp;&nbsp;szIcon.cy = 8;</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;if( bDraw )<BR>&nbsp;&nbsp;&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Only draw it if we were asked to<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DrawIconEx( pDC-&gt;GetSafeHdc(), pt.x, pt.y, hIcon, szIcon.cx, szIcon.cy, 0, NULL, DI_NORMAL );<BR>&nbsp;&nbsp;&nbsp;&nbsp;}</DIV><DIV>&nbsp;&nbsp;&nbsp;&nbsp;return TRUE;<BR>&nbsp;&nbsp;&nbsp;}</DIV><DIV>&nbsp;&nbsp;&nbsp;// There is no icon so modify icon size to "0" so tab width and caption position are layed out properly<BR>&nbsp;&nbsp;&nbsp;szIcon.cx = 0;<BR>&nbsp;&nbsp;&nbsp;return FALSE;<BR>&nbsp;&nbsp;};<BR>&nbsp;};</DIV><DIV><BR>&nbsp;virtual CWorkspace* CreateWorkspace()<BR>&nbsp;{<BR>&nbsp;&nbsp;return new CMyWorkspace();<BR>&nbsp;}</DIV><DIV>&nbsp;virtual HICON GetItemIcon(const CXTPTabManagerItem* pItem) const<BR>&nbsp;{<BR>&nbsp;&nbsp;HICON hIcon = NULL;<BR>&nbsp;&nbsp;if( pItem )<BR>&nbsp;&nbsp;{<BR>&nbsp;&nbsp;&nbsp;// Obtain icon to use from frame window or return NULL if none<BR>&nbsp;&nbsp;&nbsp;HWND hWnd = pItem-&gt;GetHandle();<BR>&nbsp;&nbsp;&nbsp;hIcon = (HICON)::SendMessage(hWnd, WM_XTP_GETTABICON, 0, 0);<BR>&nbsp;&nbsp;}</DIV><DIV>&nbsp;&nbsp;return hIcon ? hIcon : NULL;<BR>&nbsp;};<BR>};<BR></pre></td></tr></table></DIV>]]>
   </description>
   <pubDate>Mon, 31 Jul 2006 04:00:33 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=2395&amp;PID=14480&amp;title=cxtptabclientwnd-tab-change-icon#14480</guid>
  </item> 
  <item>
   <title><![CDATA[CXTPTabClientWnd tab change ic&#111;n : I am using this method and an...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=2395&amp;PID=14468&amp;title=cxtptabclientwnd-tab-change-icon#14468</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1322">danpetitt</a><br /><strong>Subject:</strong> 2395<br /><strong>Posted:</strong> 30 July 2006 at 6:26pm<br /><br />I am using this method and an overridden CXTTabClientWnd::GetTabIcon to draw an 'occasional' icon on my client tabs. <DIV>&nbsp;</DIV><DIV>However the tabs that dont get an icon still has the caption text moved to the right the width of an icon even when there isnt one.</DIV><DIV>&nbsp;</DIV><DIV>Is there any chance that the space is only allocated if the GetTabIcon returns TRUE?</DIV><DIV>&nbsp;</DIV><DIV>Or perhaps there is a nice way of doing this?</DIV><DIV>&nbsp;</DIV><DIV>It would also be nice to specify the size of the icon used (i dont want 16x16) and also the location "Left/Right".</DIV>]]>
   </description>
   <pubDate>Sun, 30 Jul 2006 18:26:48 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=2395&amp;PID=14468&amp;title=cxtptabclientwnd-tab-change-icon#14468</guid>
  </item> 
  <item>
   <title><![CDATA[CXTPTabClientWnd tab change ic&#111;n : TabClient send WM_XTP_GETTABICON...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=2395&amp;PID=7220&amp;title=cxtptabclientwnd-tab-change-icon#7220</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 2395<br /><strong>Posted:</strong> 22 June 2005 at 3:50am<br /><br /><P>TabClient send WM_XTP_GETTABICON first to get current icon:</P><P>BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWnd)<BR>&nbsp;//{{AFX_MSG_MAP(CChildFrame)<BR>&nbsp;ON_COMMAND(ID_BACK, OnBack)<BR>&nbsp;ON_MESSAGE(WM_XTP_GETTABICON, OnGetTabIcon)<BR>&nbsp;//}}AFX_MSG_MAP<BR>END_MESSAGE_MAP()<BR></P><P>void CChildFrame::OnBack() <BR>{<BR>&nbsp;HICON hIcon = AfxGetApp()-&gt;LoadIcon(IDR_MAINFRAME);<BR>&nbsp;SetIcon(hIcon, FALSE);<BR>&nbsp;GetParentFrame()-&gt;RecalcLayout();<BR>}</P><P>LRESULT CChildFrame::OnGetTabIcon(WPARAM, LPARAM)<BR>{<BR>&nbsp;return ::SendMessage(m_hWnd, WM_GETICON, ICON_SMALL, 0);<BR>}<BR></P>]]>
   </description>
   <pubDate>Wed, 22 Jun 2005 03:50:07 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=2395&amp;PID=7220&amp;title=cxtptabclientwnd-tab-change-icon#7220</guid>
  </item> 
  <item>
   <title><![CDATA[CXTPTabClientWnd tab change ic&#111;n :  CXTPTabClientWnd tab dose not...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=2395&amp;PID=7119&amp;title=cxtptabclientwnd-tab-change-icon#7119</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=1247">ruanjiandev</a><br /><strong>Subject:</strong> 2395<br /><strong>Posted:</strong> 16 June 2005 at 8:18pm<br /><br /><br>CXTPTabClientWnd tab dose not change the icon automatically when I change the icon of the MDIFrame by call SetIcon(...)<br><br>Any one know the workaround? thanks<br><br>]]>
   </description>
   <pubDate>Thu, 16 Jun 2005 20:18:18 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=2395&amp;PID=7119&amp;title=cxtptabclientwnd-tab-change-icon#7119</guid>
  </item> 
 </channel>
</rss>