<?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 : EnableFrameTheme when CMainFrame is not main wnd</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Toolkit Pro : EnableFrameTheme when CMainFrame is not main wnd]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Mon, 20 Apr 2026 16:55:32 +0000</pubDate>
  <lastBuildDate>Thu, 30 Jun 2011 02:33:54 +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=18597</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[EnableFrameTheme when CMainFrame is not main wnd : Hi,For Child frames I don&amp;#039;t...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=18597&amp;PID=65064&amp;title=enableframetheme-when-cmainframe-is-not-main-wnd#65064</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 18597<br /><strong>Posted:</strong> 30 June 2011 at 2:33am<br /><br />Hi,<div><br></div><div>For Child frames I don't recommend you such workarounds. Just don't call&nbsp;EnableFrameTheme.</div>]]>
   </description>
   <pubDate>Thu, 30 Jun 2011 02:33:54 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=18597&amp;PID=65064&amp;title=enableframetheme-when-cmainframe-is-not-main-wnd#65064</guid>
  </item> 
  <item>
   <title><![CDATA[EnableFrameTheme when CMainFrame is not main wnd :  Hi Oleg,My Dialog has a caption...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=18597&amp;PID=65046&amp;title=enableframetheme-when-cmainframe-is-not-main-wnd#65046</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6868">Cyprien</a><br /><strong>Subject:</strong> 18597<br /><strong>Posted:</strong> 29 June 2011 at 3:30am<br /><br />Hi Oleg,<br><br>My Dialog has a caption and borders, the main frame has no caption and no border.<br>If I don't call EnableFrameTheme I Can see the dialog caption and below the ribbon and it works as expected.<br><br>Here is a sample project I did yesterday which reproduces the problem<br><a href="uploads/6868/Ribb&#111;nFrameTheme.zip" target="_blank">uploads/6868/RibbonFrameTheme.zip</a><br><br>When you click on EnableFrameTheme (in the ribbon) there are no visual changes but you can move the window containing the ribbon inside the dialog box.<br><br>The following modifications produces a better visual result but doesn't fully work :<br>In XTPCommandBar.h line 371 add virtual before CWnd* GetSite() const;<br>In XTPOffice2007FrameHook.cpp, CXTPOffice2007FrameHook::EnableOffice2007Frame(CXTPCommandBars* pCommandBars)<br>replace<br><table width="99%"><tr><td><pre class="BBcode"><br>&nbsp; if (pCommandBars)<br>&nbsp;&nbsp;&nbsp; {<br>#ifdef _XTP_INCLUDE_RIBBON<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_pRibbonBar = DYNAMIC_DOWNCAST(CXTPRibbonBar, pCommandBars-&gt;GetMenuBar());<br>#endif<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_hwndSite = pCommandBars-&gt;GetSite()-&gt;GetSafeHwnd();<br>&nbsp; }<br></pre></td></tr></table><br><br>with<br><table width="99%"><tr><td><pre class="BBcode"><br>&nbsp; if (pCommandBars)<br>&nbsp; {<br>#ifdef _XTP_INCLUDE_RIBBON<br>&nbsp;&nbsp;&nbsp; m_pRibbonBar = DYNAMIC_DOWNCAST(CXTPRibbonBar, pCommandBars-&gt;GetMenuBar());<br>#endif<br>&nbsp;&nbsp;&nbsp; m_hwndSite = pCommandBars-&gt;GetSite()-&gt;GetSafeHwnd();<br>&nbsp;&nbsp;&nbsp; if (m_hwndSite)<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; HWND hParent = GetParent(m_hwndSite);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while (hParent)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; m_hwndSite = hParent;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hParent = GetParent(hParent);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp; }<br></pre></td></tr></table><br>In CXTPRibbonBar, overload the virtual method virtual CWnd* GetSite() const; with<br><table width="99%"><tr><td><pre class="BBcode"><br>CWnd* CXTPRibbonBar::GetSite() const<br>{<br>&nbsp; if (IsFrameThemeEnabled())<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; return m_pFrameHook-&gt;GetSite();<br>&nbsp; }<br>&nbsp; else<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; return __super::GetSite();<br>&nbsp; }<br>}<br></pre></td></tr></table>]]>
   </description>
   <pubDate>Wed, 29 Jun 2011 03:30:45 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=18597&amp;PID=65046&amp;title=enableframetheme-when-cmainframe-is-not-main-wnd#65046</guid>
  </item> 
  <item>
   <title><![CDATA[EnableFrameTheme when CMainFrame is not main wnd : So your dialog don&amp;#039;t have...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=18597&amp;PID=65044&amp;title=enableframetheme-when-cmainframe-is-not-main-wnd#65044</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 18597<br /><strong>Posted:</strong> 29 June 2011 at 2:59am<br /><br />So your dialog don't have frame/caption and you want that your child frame as replacement of dialog's ?<div><br></div><div>If you don't call&nbsp;<span ="Apple-style-span" style=": rgb248, 248, 252; ">EnableFrameTheme it works like you expected ? &nbsp;</span></div><div><br></div>]]>
   </description>
   <pubDate>Wed, 29 Jun 2011 02:59:28 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=18597&amp;PID=65044&amp;title=enableframetheme-when-cmainframe-is-not-main-wnd#65044</guid>
  </item> 
  <item>
   <title><![CDATA[EnableFrameTheme when CMainFrame is not main wnd : Hello,The software I&amp;#039;m working...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=18597&amp;PID=65033&amp;title=enableframetheme-when-cmainframe-is-not-main-wnd#65033</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6868">Cyprien</a><br /><strong>Subject:</strong> 18597<br /><strong>Posted:</strong> 28 June 2011 at 8:46am<br /><br />Hello,<br><br>The software I'm working on has a very particular configuration. The CXTPFrameWnd derived class is not the main window of the application. The CMainFrame window is in a COleControl, and the COleControl is in a CDialog. (This allow an ActiveX usage of CMainFrame). For the user it's just like if there where only a the main frame.<br>I can use a ribbon in my main frame, but when I call EnableFrameTheme, It does'nt work as expected :<br>The mainframe can be moved inside the main dialog !<br><br>I tried some modification in ToolkitPro sources in order to have CXTPRibbonBar::GetSite() and CXTPOffice2007FrameHook::m_hwndSite be the parent window of the application. It solves some problems but it's not enough : the maximize/minimize/close buttons don't work.<br><br>Can someone help me please ?<br><br>Thanks<br>Cyprien&nbsp;]]>
   </description>
   <pubDate>Tue, 28 Jun 2011 08:46:57 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=18597&amp;PID=65033&amp;title=enableframetheme-when-cmainframe-is-not-main-wnd#65033</guid>
  </item> 
 </channel>
</rss>