<?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 : Skin Framework</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Skin Framework : Last 10 Posts]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Mon, 07 Sep 2026 10:30:39 +0000</pubDate>
  <lastBuildDate>Tue, 01 Sep 2026 13:33:35 +0000</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 12.04</generator>
  <ttl>30</ttl>
  <WebWizForums:feedURL>forum.codejock.com/RSS_topic_feed.asp?FID=130</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[Skin Framework : Context menu tracking when Skinning]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=24694&amp;PID=79473&amp;title=context-menu-tracking-when-skinning#79473</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3213">rdhd</a><br /><strong>Subject:</strong> Context menu tracking when Skinning<br /><strong>Posted:</strong> 01 September 2026 at 1:33pm<br /><br /><div>Mea cupla. It wasn't skinning that caused the dismissal. It was the fact that I had to use CJ TrackPopupMenu to get the skin applied to the context menu. We have the code here being used in cases where we don't have a popup displaying the item for which we are showing the context menu.</div><div><br></div><div>So I guess the work-around I have though seemingly a bit dangerous (subject to CJ changes over time ...) is probably the best I can do.</div>]]>
   </description>
   <pubDate>Tue, 01 Sep 2026 13:33:35 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=24694&amp;PID=79473&amp;title=context-menu-tracking-when-skinning#79473</guid>
  </item> 
  <item>
   <title><![CDATA[Skin Framework : Context menu tracking when Skinning]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=24694&amp;PID=79472&amp;title=context-menu-tracking-when-skinning#79472</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3213">rdhd</a><br /><strong>Subject:</strong> Context menu tracking when Skinning<br /><strong>Posted:</strong> 01 September 2026 at 1:18pm<br /><br /><div>I found that when I have a skin applied and I do a right click on a control on some of our popups the context menu I track causes the popup to dismiss. To fix that I found I could pass in TPM_RECURSE when tracking the popup menu. That keeps CJ from closing the popup. Unfortunately it also lets CJ track the mouse wrt the popup as well as the context menu (popup itself). Well sort of. The context menu items don't highlight as I move over them though the items on the popup below it do. When I click a context menu item I do get the command ID back.</div><div><br></div><div>Not a fan of my work-around which is described and implemented as:</div><div><br></div><div><pre style="font-family:'Cascadia Mono';font-size:9pt;color:#000000">            <span style="color:#008000">// 12/22/25: RDH PR 11388058. This code was changed to call the frame window so the menu displays a Dark</span>            <span style="color:#008000">// theme. That api routes through Codejock's CXTPCommandBars::TrackPopupMenu, which calls</span>            <span style="color:#008000">// XTPMouseManager::SendTrackLost on entry. SendTrackLost walks CXTPMouseManager::m_arrTracked calling</span>            <span style="color:#008000">// OnTrackLost, which ends tracking mode on the MRUPopupBar and closes the vertical MRU out from under us.</span>            <span style="color:#008000">//</span>            <span style="color:#008000">// 8/31/26 RDH: That was originally worked around by passing TPM_RECURSE, because Codejock skips</span>            <span style="color:#008000">// SendTrackLost when that flag is set. But TPM_RECURSE does not mean "leave my popup alone" - it also</span>            <span style="color:#008000">// calls LockTrackRecurse(TRUE), which bumps m_nLockRecurse on EVERY bar already being tracked, and</span>            <span style="color:#008000">// m_nLockRecurse is the flag that gates all hot tracking (CXTPPopupBar::OnMouseMove,</span>            <span style="color:#008000">// CXTPCommandBar::OnMouseMove and OnMouseLeave, the hover timers, CXTPMouseManager::DeliverMessage).</span>            <span style="color:#008000">// The result was a context menu whose items never highlighted, and stale highlights left lit on the MRU</span>            <span style="color:#008000">// items underneath because nothing was allowed to clear them.</span>            <span style="color:#008000">//</span>            <span style="color:#008000">// Removing just our own bar from the tracked array is not enough, and it is worth knowing why. An</span>            <span style="color:#008000">// MRUPopupBar is a CXTPRibbonSystemPopupBarPage, that is, a page of the system menu popup that spawned</span>            <span style="color:#008000">// it, and that parent bar is tracked too. SendTrackLost calls OnTrackLost on the parent, the parent</span>            <span style="color:#008000">// closes its child popups, and ours goes down with it however carefully we detached it. That is exactly</span>            <span style="color:#008000">// what TPM_RECURSE was papering over by locking the whole array rather than one entry.</span>            <span style="color:#008000">//</span>            <span style="color:#008000">// So do what TPM_RECURSE did, minus the freeze: lift the entire tracked array out for the duration of</span>            <span style="color:#008000">// the call and put it back afterwards. SendTrackLost then has nothing to walk and is a no op, every</span>            <span style="color:#008000">// bar keeps its tracking mode, and because nobody gets m_nLockRecurse set the context menu hot tracks</span>            <span style="color:#008000">// normally. The bars are restored in their original order, since SetTrack appends.</span>            <span style="color:#008000">//</span>            <span style="color:#008000">//</span>            <span style="color:#008000">// Do not try to solve this by vetoing dismissal in MRUPopupBar::SetTrackingMode instead. SendTrackLost</span>            <span style="color:#008000">// is "while (m_arrTracked.GetSize() &gt; 0) m_arrTracked&#091;0&#093;-&gt;OnTrackLost();" - a veto that stops a bar</span>            <span style="color:#008000">// being removed from the array hangs the thread.</span>            <span style="color:#2b91af">CXTPCommandBar</span>*   pOwningBar     = <span style="color:#6f008a">DYNAMIC_DOWNCAST</span><span style="color:#1a94ff">(</span><span style="color:#2b91af">MRUPopupBar</span>, GetParent<span style="color:#ffd702">()</span><span style="color:#1a94ff">)</span>;            <span style="color:#2b91af">CXTPMouseManager</span>* pMouseManager  = XTPMouseManager<span style="color:#1a94ff">()</span>;            std::<span style="color:#2b91af">vector</span>&lt;<span style="color:#2b91af">CXTPCommandBar</span>*&gt; vecSuspendedBars;            <span style="color:#0000ff">if</span><span style="color:#1a94ff">(</span>pOwningBar &amp;&amp; pMouseManager<span style="color:#1a94ff">)</span>            <span style="color:#1a94ff">{</span>                <span style="color:#2b91af">CXTPMouseManager</span>::<span style="color:#2b91af">CTrackArray</span>&amp; arrTracked = pMouseManager-&gt;GetTrackArray<span style="color:#ffd702">()</span>;                <span style="color:#0000ff">for</span><span style="color:#ffd702">(</span><span style="color:#0000ff">int</span> i = 0; i &lt; <span style="color:#d86ac2">(</span><span style="color:#0000ff">int</span><span style="color:#d86ac2">)</span>arrTracked.GetSize<span style="color:#d86ac2">()</span>; i++<span style="color:#ffd702">)</span>                <span style="color:#ffd702">{</span>                    vecSuspendedBars.push_back<span style="color:#d86ac2">(</span>arrTracked<span style="color:#008080">&#091;</span>i<span style="color:#008080">&#093;</span><span style="color:#d86ac2">)</span>;                <span style="color:#ffd702">}</span>                <span style="color:#0000ff">for</span><span style="color:#ffd702">(</span><span style="color:#2b91af">size_t</span> i = 0; i &lt; vecSuspendedBars.size<span style="color:#d86ac2">()</span>; i++<span style="color:#ffd702">)</span>                <span style="color:#ffd702">{</span>                    pMouseManager-&gt;RemoveTrack<span style="color:#d86ac2">(</span>vecSuspendedBars<span style="color:#008080">&#091;</span>i<span style="color:#008080">&#093;</span><span style="color:#d86ac2">)</span>;                <span style="color:#ffd702">}</span>            <span style="color:#1a94ff">}</span>            <span style="color:#2b91af">BOOL</span> item = pFrameWnd-&gt;TrackPopupMenu<span style="color:#1a94ff">(</span>subMenu, <span style="color:#6f008a">TPM_RETURNCMD</span> | <span style="color:#6f008a">TPM_LEFTALIGN</span> | <span style="color:#6f008a">TPM_LEFTBUTTON</span>, point.x, point.y, <span style="color:#0000ff">this</span>, <span style="color:#0000ff">nullptr</span>, <span style="color:#2f4f4f">JNone</span>, hInstance<span style="color:#1a94ff">)</span>;            <span style="color:#0000ff">for</span><span style="color:#1a94ff">(</span><span style="color:#2b91af">size_t</span> i = 0; i &lt; vecSuspendedBars.size<span style="color:#ffd702">()</span>; i++<span style="color:#1a94ff">)</span>            <span style="color:#1a94ff">{</span>                <span style="color:#008000">// The window can be gone if a command tore the bar down while the menu was up.</span>                <span style="color:#0000ff">if</span><span style="color:#ffd702">(</span>::IsWindow<span style="color:#d86ac2">(</span>vecSuspendedBars<span style="color:#008080">&#091;</span>i<span style="color:#008080">&#093;</span>-&gt;GetSafeHwnd<span style="color:#1a94ff">()</span><span style="color:#d86ac2">)</span><span style="color:#ffd702">)</span>                <span style="color:#ffd702">{</span>                    pMouseManager-&gt;SetTrack<span style="color:#d86ac2">(</span>vecSuspendedBars<span style="color:#008080">&#091;</span>i<span style="color:#008080">&#093;</span>, <span style="color:#6f008a">FALSE</span><span style="color:#d86ac2">)</span>;                <span style="color:#ffd702">}</span>            <span style="color:#1a94ff">}</span></pre><br></div><div>As I noted before the code related to suspending and resuming tracking I made to keep the popup displayed when a skin was applied was to add TPM_RECUSE to the flags passed in. I did not determine why a skin being applied caused the dismissal and no skin applied kept the popup from being dismissed when tracking the context menu on an item in that popup. The above code now keeps the popup from being dismissed while allowing correct tracking on the item I am showing the context menu for.</div>]]>
   </description>
   <pubDate>Tue, 01 Sep 2026 13:18:38 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=24694&amp;PID=79472&amp;title=context-menu-tracking-when-skinning#79472</guid>
  </item> 
  <item>
   <title><![CDATA[Skin Framework : Menu won&#039;t draw.]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=24642&amp;PID=79413&amp;title=menu-wont-draw#79413</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3213">rdhd</a><br /><strong>Subject:</strong> Menu won&#039;t draw.<br /><strong>Posted:</strong> 10 June 2026 at 3:26pm<br /><br />I'm guessing that if I had added this code in a ribbon sample where command bar hooks would disable xtpSkinApplyFrame duplication would have been much easier. But, then I wouldn't have found out about the apply to menu option/bit contribution to the issue. I might want to revisit CJ code changes I made to get the menu to work. Or ... take the easy way out and hope y'all see the issue and make the real fix!]]>
   </description>
   <pubDate>Wed, 10 Jun 2026 15:26:47 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=24642&amp;PID=79413&amp;title=menu-wont-draw#79413</guid>
  </item> 
  <item>
   <title><![CDATA[Skin Framework : Menu won&#039;t draw.]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=24642&amp;PID=79412&amp;title=menu-wont-draw#79412</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3213">rdhd</a><br /><strong>Subject:</strong> Menu won&#039;t draw.<br /><strong>Posted:</strong> 10 June 2026 at 3:21pm<br /><br /><div>I didn't duplicate this in the SkinMDISample. At first. But I saw and unchecked the Apply menus check box on the Skins and Themes window and the sample has problems. They are a bit different from our app in as clicking the system menu shows the app menu but the issue where the app menu shows up but doesn't work. The different behaviors turned out to me due to us using command bars. Below is code I added to use the help about command to show the problem. Ignore commented code and ignore the filtering I added just to verify it works when skinning is disabled for the window. Sorry for the big code drop but I don't see an "attach file" here.</div><div><br></div><div>// App command to run the dialog<br>// NOTE: Set this to 0 to demonstrate the menu bar NOT appearing (the bug)<br>//&nbsp; &nbsp; &nbsp; &nbsp;Set this to 1 to show the workaround (filtering the window class)<br>#define USE_WINDOW_FILTER_WORKAROUND 0<br><br>static const TCHAR s_szAddInManagerDialogClass&#091;&#093; = TEXT("AddInManagerDialogClass");<br>static const TCHAR s_szMenuWindowClass&#091;&#093; = TEXT("MenuWindowClass");<br>static const TCHAR s_szAddInManagerMenuText&#091;&#093; = TEXT("Item 1");<br>static const UINT s_nAddInManagerMenuItem = 1001;<br>static const UINT s_nAddInManagerPopupCmd = 50001;<br>static HBITMAP s_hAddInManagerMenuBitmap = NULL;<br><br>//static LRESULT CALLBACK MenuWindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)<br>//{<br>//&nbsp; &nbsp; switch (message)<br>//&nbsp; &nbsp; {<br>//&nbsp; &nbsp; case WM_COMMAND:<br>//&nbsp; &nbsp; &nbsp; &nbsp; if (LOWORD(wParam) == s_nAddInManagerMenuItem)<br>//&nbsp; &nbsp; &nbsp; &nbsp; {<br>//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MessageBox(hWnd, TEXT("Menu item clicked!"), TEXT("Info"), MB_OK);<br>//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return 0;<br>//&nbsp; &nbsp; &nbsp; &nbsp; }<br>//&nbsp; &nbsp; &nbsp; &nbsp; break;<br>//<br>//&nbsp; &nbsp; case WM_CLOSE:<br>//&nbsp; &nbsp; &nbsp; &nbsp; DestroyWindow(hWnd);<br>//&nbsp; &nbsp; &nbsp; &nbsp; return 0;<br>//<br>//&nbsp; &nbsp; case WM_DESTROY:<br>//&nbsp; &nbsp; &nbsp; &nbsp; PostQuitMessage(0);<br>//&nbsp; &nbsp; &nbsp; &nbsp; return 0;<br>//&nbsp; &nbsp; }<br>//<br>//&nbsp; &nbsp; return DefWindowProc(hWnd, message, wParam, lParam);<br>//}<br><br>static LRESULT CALLBACK AddInManagerWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)<br>{<br>&nbsp; &nbsp; switch (message)<br>&nbsp; &nbsp; {<br>&nbsp; &nbsp; case WM_MEASUREITEM:<br>&nbsp; &nbsp; &nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MEASUREITEMSTRUCT* pMeasureItemStruct = reinterpret_cast&lt;MEASUREITEMSTRUCT*&gt;(lParam);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (pMeasureItemStruct &amp;&amp; pMeasureItemStruct-&gt;CtlType == ODT_MENU &amp;&amp; pMeasureItemStruct-&gt;itemID == s_nAddInManagerMenuItem)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HDC hDC = ::GetDC(hWnd);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (hDC)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SIZE size = { 0 };<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;BITMAP bmpInfo = { 0 };<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HFONT hFont = reinterpret_cast&lt;HFONT&gt;(::SendMessage(hWnd, WM_GETFONT, 0, 0));<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HFONT hOldFont = hFont ? reinterpret_cast&lt;HFONT&gt;(::SelectObject(hDC, hFont)) : NULL;<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::GetTextExtentPoint32(hDC, s_szAddInManagerMenuText, lstrlen(s_szAddInManagerMenuText), &amp;size);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (s_hAddInManagerMenuBitmap)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::GetObject(s_hAddInManagerMenuBitmap, sizeof(BITMAP), &amp;bmpInfo);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (hOldFont)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::SelectObject(hDC, hOldFont);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::ReleaseDC(hWnd, hDC);<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pMeasureItemStruct-&gt;itemWidth = bmpInfo.bmWidth + size.cx + (::GetSystemMetrics(SM_CXMENUCHECK) * 2) + 8;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pMeasureItemStruct-&gt;itemHeight = max(size.cy, bmpInfo.bmHeight) + 6;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return TRUE;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; break;<br><br>&nbsp; &nbsp; case WM_DRAWITEM:<br>&nbsp; &nbsp; &nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DRAWITEMSTRUCT* pDrawItemStruct = reinterpret_cast&lt;DRAWITEMSTRUCT*&gt;(lParam);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (pDrawItemStruct &amp;&amp; pDrawItemStruct-&gt;CtlType == ODT_MENU &amp;&amp; pDrawItemStruct-&gt;itemID == s_nAddInManagerMenuItem)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; RECT rcItem = pDrawItemStruct-&gt;rcItem;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; COLORREF crText = (pDrawItemStruct-&gt;itemState &amp; ODS_SELECTED) ? ::GetSysColor(COLOR_HIGHLIGHTTEXT) : RGB(255, 0, 0);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; BITMAP bmpInfo = { 0 };<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::FillRect(pDrawItemStruct-&gt;hDC, &amp;rcItem, ::GetSysColorBrush((pDrawItemStruct-&gt;itemState &amp; ODS_SELECTED) ? COLOR_HIGHLIGHT : COLOR_MENU));<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int nOldBkMode = ::SetBkMode(pDrawItemStruct-&gt;hDC, TRANSPARENT);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; COLORREF crOldText = ::SetTextColor(pDrawItemStruct-&gt;hDC, crText);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HFONT hFont = reinterpret_cast&lt;HFONT&gt;(::SendMessage(hWnd, WM_GETFONT, 0, 0));<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HFONT hOldFont = hFont ? reinterpret_cast&lt;HFONT&gt;(::SelectObject(pDrawItemStruct-&gt;hDC, hFont)) : NULL;<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (s_hAddInManagerMenuBitmap)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::GetObject(s_hAddInManagerMenuBitmap, sizeof(BITMAP), &amp;bmpInfo);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HDC hdcBitmap = ::CreateCompatibleDC(pDrawItemStruct-&gt;hDC);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (hdcBitmap)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; HBITMAP hOldBitmap = reinterpret_cast&lt;HBITMAP&gt;(::SelectObject(hdcBitmap, s_hAddInManagerMenuBitmap));<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int nBitmapTop = rcItem.top + ((rcItem.bottom - rcItem.top) - bmpInfo.bmHeight) / 2;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::BitBlt(pDrawItemStruct-&gt;hDC,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rcItem.left + 2,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; nBitmapTop,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bmpInfo.bmWidth,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; bmpInfo.bmHeight,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; hdcBitmap,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 0,<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SRCCOPY);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::SelectObject(hdcBitmap, hOldBitmap);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::DeleteDC(hdcBitmap);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; rcItem.left += max(::GetSystemMetrics(SM_CXMENUCHECK), bmpInfo.bmWidth) + 6;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::DrawText(pDrawItemStruct-&gt;hDC, s_szAddInManagerMenuText, -1, &amp;rcItem, DT_SINGLELINE | DT_VCENTER | DT_LEFT);<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (pDrawItemStruct-&gt;itemState &amp; ODS_FOCUS)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::DrawFocusRect(pDrawItemStruct-&gt;hDC, &amp;pDrawItemStruct-&gt;rcItem);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (hOldFont)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::SelectObject(pDrawItemStruct-&gt;hDC, hOldFont);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::SetTextColor(pDrawItemStruct-&gt;hDC, crOldText);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ::SetBkMode(pDrawItemStruct-&gt;hDC, nOldBkMode);<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return TRUE;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; break;<br><br>&nbsp; &nbsp; case WM_CLOSE:<br>&nbsp; &nbsp; &nbsp; &nbsp; DestroyWindow(hWnd);<br>&nbsp; &nbsp; &nbsp; &nbsp; return 0;<br>&nbsp; &nbsp; }<br><br>&nbsp; &nbsp; return DefDlgProc(hWnd, message, wParam, lParam);<br>}<br><br>static const std::map&lt;std::string, int&gt; kStringToInt<br>{<br>&nbsp; &nbsp; { "MenuWindowClass", 1 },<br>&nbsp; &nbsp; { "AddInManagerDialogClass", 1 },<br>};<br>static const std::map&lt;std::wstring, int&gt; kWStringToInt<br>{<br>&nbsp; &nbsp; { L"MenuWindowClass", 1 },<br>&nbsp; &nbsp; { L"AddInManagerDialogClass", 1 },<br>};<br><br>struct JIXTPSkinManagerWindowFilter : IXTPSkinManagerWindowFilter<br>{<br>&nbsp; &nbsp; ~JIXTPSkinManagerWindowFilter()<br>&nbsp; &nbsp; {<br>&nbsp; &nbsp; }<br><br>&nbsp; &nbsp; // IXTPSkinManagerWindowFilter<br>&nbsp; &nbsp; BOOL FilterWindowClass(LPCSTR lpszClassName)<br>&nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; // Trying to include a a part copy of a Parasolid file resulted in a lockup due to CodeJock trying to skinning the DDEMLEvent window.<br>&nbsp; &nbsp; &nbsp; &nbsp; // We need to prevent skinning of this window class (which is not visible to the end user) as it is an internal windows class.<br><br>&nbsp; &nbsp; &nbsp; &nbsp; return lpszClassName &amp;&amp; (kStringToInt.find(lpszClassName) != kStringToInt.end());<br>&nbsp; &nbsp; }<br>&nbsp; &nbsp; BOOL FilterWindowClass(LPCWSTR lpszClassName)<br>&nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; // Trying to include a a part copy of a Parasolid file resulted in a lockup due to CodeJock trying to skinning the DDEMLEvent window.<br>&nbsp; &nbsp; &nbsp; &nbsp; // We need to prevent skinning of this window class (which is not visible to the end user) as it is an internal windows class.<br>&nbsp; &nbsp; &nbsp; &nbsp; return lpszClassName &amp;&amp; (kWStringToInt.find(lpszClassName) != kWStringToInt.end());<br>&nbsp; &nbsp; }<br>&nbsp; &nbsp; BOOL FilterWindow(HWND hWnd,LPCTSTR lpszClassName,LPCREATESTRUCT lpcs)<br>&nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; // Trying to include a a part copy of a Parasolid file resulted in a lockup due to CodeJock trying to skinning the DDEMLEvent window.<br>&nbsp; &nbsp; &nbsp; &nbsp; // We need to prevent skinning of this window class (which is not visible to the end user) as it is an internal windows class.<br>&nbsp; &nbsp; &nbsp; &nbsp; return lpszClassName &amp;&amp; (kWStringToInt.find(lpszClassName) != kWStringToInt.end());<br>&nbsp; &nbsp; }<br>};<br><br>static JIXTPSkinManagerWindowFilter s_JSkinManagerWindowFilter;<br><br>/////////////////////////////////////////////////////////////////////////////<br>// ISSUE DEMONSTRATION FOR CODEJOCK:<br>//&nbsp;<br>// This code creates a window with a menu bar using CreateWindowEx and DefDlgProc.<br>// This is the EXACT same code used in Solid Edge by a third-party add-in developer.<br>//&nbsp;<br>// ORIGINAL ISSUE IN SOLID EDGE (with skin applied):<br>//&nbsp; &nbsp;- Menu bar IS visible<br>//&nbsp; &nbsp;- BUT clicking menu items does NOT display submenus (dropdowns don't appear)<br>//&nbsp; &nbsp;- Without skin, everything works fine<br>//&nbsp;<br>// ISSUE IN THIS SAMPLE (with skin applied):<br>//&nbsp; &nbsp;- Menu bar does NOT even appear at all!<br>//&nbsp; &nbsp;- Cannot test the submenu dropdown issue because menu bar itself is missing<br>//&nbsp; &nbsp; &nbsp;- BUT, in the sample uncheck the apply menus button and then you see what Solid Edge<br>//&nbsp; &nbsp; &nbsp;saw before my CJ code changes - The window menu appears but clicking does nothing.<br>//&nbsp; &nbsp; &nbsp;Also, click the system menu and the app menu does appear instead of the system menu.<br>//&nbsp; &nbsp; &nbsp;I did not make that code change in Solid Edge to remove xtpSkinApplyMenus. So, that is another difference<br>//&nbsp; &nbsp; &nbsp;between Solid Edge with no CJ skin code changes I made to address the issue and this sample.<br>//&nbsp; &nbsp; &nbsp;<br>//&nbsp; &nbsp; &nbsp;However, we use command bars (ribbon) code and I see thecommand bars hook calls DisableSkinFrameOption.<br>//&nbsp; &nbsp; &nbsp;So, In Solid Edge SkinManager::m_dwApplyOptions is 0x1d while in this app it is 0x17 when I uncheck<br>//&nbsp; &nbsp; &nbsp;that apply menus box.<br>//&nbsp;<br>//&nbsp; &nbsp; &nbsp; &nbsp;Now that I know the options are different, I can exactly replicate the issue Solid Edge has by<br>//&nbsp; &nbsp; &nbsp;setting a breakpoint in the CXTPSkinManager constructor right after m_dwApplyOptions is initialized<br>//&nbsp; &nbsp; &nbsp;and then setting it to 0x1d. Do that and clicking the app menu does nothing and clicking the system<br>//&nbsp; &nbsp; &nbsp;menu shows that menu.<br>//&nbsp;<br>//&nbsp;<br>//&nbsp;<br>// WORKAROUND: Use SetWindowFilter to exclude the window class from skinning<br>//&nbsp; &nbsp;- With filter: Menu bar appears and is functional<br>//&nbsp; &nbsp;- Without filter: Menu bar doesn't appear in this sample<br>//&nbsp;<br>// TO DEMONSTRATE THE ISSUE:<br>//&nbsp; &nbsp;1. Set USE_WINDOW_FILTER_WORKAROUND to 0 (above)<br>//&nbsp; &nbsp;2. Rebuild and run - menu bar will NOT appear (can't even test submenu issue)<br>//&nbsp; &nbsp;3. Set USE_WINDOW_FILTER_WORKAROUND to 1 (above)<br>//&nbsp; &nbsp;4. Rebuild and run - menu bar appears, test if clicking "Menu" shows "Item 1" submenu<br>//<br>// QUESTIONS FOR CODEJOCK:<br>//&nbsp; &nbsp;1. Why does the menu bar appear in Solid Edge but not in this sample?<br>//&nbsp; &nbsp;2. Why don't menu submenus display when clicked (in Solid Edge with skin)?<br>//&nbsp; &nbsp;3. Is there a proper fix that doesn't require filtering out the window?<br>/////////////////////////////////////////////////////////////////////////////<br>void CSkinMDISampleApp::OnAppAbout()<br>{<br>#if USE_WINDOW_FILTER_WORKAROUND<br>&nbsp; &nbsp; // WORKAROUND: Filter the window class to prevent SkinFramework from interfering with menu<br>&nbsp; &nbsp; // NOTE: In Solid Edge, menu bar appears WITHOUT this filter, but submenus don't work<br>&nbsp; &nbsp; //&nbsp; &nbsp; &nbsp; &nbsp;In this sample, menu bar doesn't even appear WITHOUT this filter<br>&nbsp; &nbsp; CXTPSkinManager* pTheSkinnyOne = XTPSkinManager();<br><br>&nbsp; &nbsp; if( pTheSkinnyOne )<br>&nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; pTheSkinnyOne-&gt;SetWindowFilter(&amp;s_JSkinManagerWindowFilter);<br>&nbsp; &nbsp; }<br>#endif<br><br>&nbsp; HWND hDialog;<br>&nbsp; WNDCLASSEX wc = { 0 };<br>&nbsp; wc.cbSize = sizeof(WNDCLASSEX);<br>&nbsp; wc.lpfnWndProc = AddInManagerWndProc;<br>&nbsp; wc.hInstance = GetModuleHandle(NULL);<br>&nbsp; wc.lpszClassName = s_szAddInManagerDialogClass;<br>&nbsp; wc.cbWndExtra = DLGWINDOWEXTRA;<br>&nbsp; if (!RegisterClassEx(&amp;wc) &amp;&amp; GetLastError() != ERROR_CLASS_ALREADY_EXISTS)<br>&nbsp; {<br>&nbsp; &nbsp; &nbsp; return;<br>&nbsp; }<br><br>&nbsp; hDialog = CreateWindowEx(0, s_szAddInManagerDialogClass, TEXT("Dialog with menu"),<br>&nbsp; &nbsp; WS_OVERLAPPEDWINDOW | WS_VISIBLE,<br>&nbsp; &nbsp; 100, 100, 500, 300, NULL, NULL, GetModuleHandle(NULL), NULL);<br>&nbsp; if (!hDialog)<br>&nbsp; {<br>&nbsp; &nbsp; &nbsp; return;<br>&nbsp; }<br><br>&nbsp; HMENU hMenu = ::CreateMenu();<br>&nbsp; HMENU hSubMenu = ::CreatePopupMenu();<br>&nbsp; AppendMenu(hSubMenu, MF_POPUP /*MF_OWNERDRAW*/, s_nAddInManagerMenuItem, s_szAddInManagerMenuText);<br>&nbsp; AppendMenu(hMenu, MF_POPUP, (UINT_PTR)hSubMenu, TEXT("Menu"));<br><br>&nbsp; SetMenu(hDialog, hMenu);<br>&nbsp; DrawMenuBar(hDialog);<br>}<br><br>// App command to run the dialog<br>//void CSkinMDISampleApp::OnAppAbout()<br>//{<br>//&nbsp; &nbsp; CAboutDlg aboutDlg;<br>//&nbsp; &nbsp; aboutDlg.DoModal();<br>//}<br><br></div>]]>
   </description>
   <pubDate>Wed, 10 Jun 2026 15:21:48 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=24642&amp;PID=79412&amp;title=menu-wont-draw#79412</guid>
  </item> 
  <item>
   <title><![CDATA[Skin Framework : Menu won&#039;t draw.]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=24642&amp;PID=79411&amp;title=menu-wont-draw#79411</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3213">rdhd</a><br /><strong>Subject:</strong> Menu won&#039;t draw.<br /><strong>Posted:</strong> 10 June 2026 at 8:30am<br /><br />Let me put one together as I just went into our app and hijacked a command where I put the code I posted here. And, owner draw doesn't matter. I added owner draw to see if the issue was with the background and text colors. But, no messages to draw ever arrive.]]>
   </description>
   <pubDate>Wed, 10 Jun 2026 08:30:06 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=24642&amp;PID=79411&amp;title=menu-wont-draw#79411</guid>
  </item> 
  <item>
   <title><![CDATA[Skin Framework : Menu won&#039;t draw.]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=24642&amp;PID=79410&amp;title=menu-wont-draw#79410</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=9012">agontarenko</a><br /><strong>Subject:</strong> Menu won&#039;t draw.<br /><strong>Posted:</strong> 10 June 2026 at 3:21am<br /><br /><div>Hello,</div><div><br></div><div>As I understand it, you're using a menu with the MF_OWNERDRAW flag and a skin together, and that's causing the problem. But I couldn't reproduce it. I created a similar app using MFC.</div><div>We understand you don't own the code, but we need to debug it to figure out what the issue is.<br>Can you provide example with this problem?&nbsp;</div><div><br></div><div><div>Regards,</div><div>Artem Gontarenko</div><br></div>]]>
   </description>
   <pubDate>Wed, 10 Jun 2026 03:21:08 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=24642&amp;PID=79410&amp;title=menu-wont-draw#79410</guid>
  </item> 
  <item>
   <title><![CDATA[Skin Framework : Menu won&#039;t draw.]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=24642&amp;PID=79408&amp;title=menu-wont-draw#79408</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3213">rdhd</a><br /><strong>Subject:</strong> Menu won&#039;t draw.<br /><strong>Posted:</strong> 08 June 2026 at 9:57am<br /><br />What I have isn't an MFC app though our app is based on MFC. The code I dropped is just "classic"/Petzold sort of programming.]]>
   </description>
   <pubDate>Mon, 08 Jun 2026 09:57:04 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=24642&amp;PID=79408&amp;title=menu-wont-draw#79408</guid>
  </item> 
  <item>
   <title><![CDATA[Skin Framework : Menu won&#039;t draw.]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=24642&amp;PID=79407&amp;title=menu-wont-draw#79407</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=9012">agontarenko</a><br /><strong>Subject:</strong> Menu won&#039;t draw.<br /><strong>Posted:</strong> 08 June 2026 at 7:30am<br /><br /><div><img src="uploads/9012/test3.png" height="286" width="1292" border="0" /></div><div><br></div><div>This is CFrameWnd base window (SDI)&nbsp;test.</div><div><br></div><div>Regards,</div><div>Artem Gontarenko</div>]]>
   </description>
   <pubDate>Mon, 08 Jun 2026 07:30:48 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=24642&amp;PID=79407&amp;title=menu-wont-draw#79407</guid>
  </item> 
  <item>
   <title><![CDATA[Skin Framework : Menu won&#039;t draw.]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=24642&amp;PID=79406&amp;title=menu-wont-draw#79406</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=9012">agontarenko</a><br /><strong>Subject:</strong> Menu won&#039;t draw.<br /><strong>Posted:</strong> 08 June 2026 at 5:33am<br /><br /><img src="uploads/9012/3nv82bF2wY_2026-06-08_05-33-13.png" height="365" width="490" border="0" />]]>
   </description>
   <pubDate>Mon, 08 Jun 2026 05:33:18 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=24642&amp;PID=79406&amp;title=menu-wont-draw#79406</guid>
  </item> 
  <item>
   <title><![CDATA[Skin Framework : Menu won&#039;t draw.]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=24642&amp;PID=79405&amp;title=menu-wont-draw#79405</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=9012">agontarenko</a><br /><strong>Subject:</strong> Menu won&#039;t draw.<br /><strong>Posted:</strong> 08 June 2026 at 5:32am<br /><br /><img src="uploads/9012/devenv_cY1bFbE2pm.png" height="1160" width="1920" border="0" />]]>
   </description>
   <pubDate>Mon, 08 Jun 2026 05:32:46 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=24642&amp;PID=79405&amp;title=menu-wont-draw#79405</guid>
  </item> 
 </channel>
</rss>