<?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 : Disable close(X) button</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Command Bars : Disable close(X) button]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Thu, 11 Jun 2026 17:43:25 +0000</pubDate>
  <lastBuildDate>Thu, 16 Oct 2008 04:36:43 +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=12341</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[Disable close(X) button : Hi,  Its not CommandBars issue...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=12341&amp;PID=42053&amp;title=disable-closex-button#42053</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 12341<br /><strong>Posted:</strong> 16 October 2008 at 4:36am<br /><br />Hi,<DIV>&nbsp;</DIV><DIV>Its not CommandBars issue :(. Its from SkinFramework. </DIV><DIV>will be fixed for 12.1 release.</DIV>]]>
   </description>
   <pubDate>Thu, 16 Oct 2008 04:36:43 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=12341&amp;PID=42053&amp;title=disable-closex-button#42053</guid>
  </item> 
  <item>
   <title><![CDATA[Disable close(X) button : First, thanks rdhd,but &amp;#034;Then...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=12341&amp;PID=42045&amp;title=disable-closex-button#42045</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4581">homaas</a><br /><strong>Subject:</strong> 12341<br /><strong>Posted:</strong> 16 October 2008 at 12:51am<br /><br />First, thanks <a href="member_profile.asp?PF=3213&amp;FID=117" target="_blank">rdhd</a>,<br>but "<font size="2">Then I went into my OnCmdMsg handler and looked for the control with an id of <font size="2">XTP_ID_MENUBAR_CLOSE. Then simply set the enabled flag of the update UI object passed in." I don't know how to do this, can you show me how to do this task? <br>Thanks a lot!<br></font></font>]]>
   </description>
   <pubDate>Thu, 16 Oct 2008 00:51:25 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=12341&amp;PID=42045&amp;title=disable-closex-button#42045</guid>
  </item> 
  <item>
   <title><![CDATA[Disable close(X) button :   I have not used skins but...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=12341&amp;PID=42042&amp;title=disable-closex-button#42042</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3213">rdhd</a><br /><strong>Subject:</strong> 12341<br /><strong>Posted:</strong> 15 October 2008 at 6:18pm<br /><br /><FONT size=2><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2></P><DIV><FONT color=#000000>I have not used skins but I do use the command ribbon with one of the word styles. For me to disable the close icon&nbsp;I first have to find the control and change the update flag. I do this:</FONT></DIV><DIV><FONT color=#000000></FONT>&nbsp;</DIV><DIV>if</FONT></FONT><FONT size=2> (CXTPControl* pCloseControl = pRibbonBar-&gt;GetControls()-&gt;FindControl(XTP_ID_MENUBAR_CLOSE))</DIV><P>{</P><P>pCloseControl-&gt;SetFlags( pCloseControl-&gt;GetFlags() &amp; ~xtpFlagManualUpdate );</P><P>}</P><DIV></DIV><DIV></DIV>Then I went into my OnCmdMsg handler and looked for the control with an id of <FONT size=2>XTP_ID_MENUBAR_CLOSE. Then simply set the enabled flag of the update UI object passed in.<DIV><DIV></DIV><DIV></DIV>I do the same thing you do to disable the original windows SC_CLOSE object and I get the menu item and examine its enabled/grayed state to base my setting of the flag. So you are almost there.</DIV></FONT></FONT>]]>
   </description>
   <pubDate>Wed, 15 Oct 2008 18:18:40 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=12341&amp;PID=42042&amp;title=disable-closex-button#42042</guid>
  </item> 
  <item>
   <title><![CDATA[Disable close(X) button : My app sometimes need to disable/enable...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=12341&amp;PID=41669&amp;title=disable-closex-button#41669</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=4581">homaas</a><br /><strong>Subject:</strong> 12341<br /><strong>Posted:</strong> 06 October 2008 at 6:07am<br /><br />My app sometimes need to disable/enable the (X) button (the top-right button on screen), it worked correctly with the following code:<br><font color="#990033"><br>&nbsp;&nbsp;&nbsp; HMENU hMenu = ::GetSystemMenu(m_hWnd,FALSE);<br>&nbsp;&nbsp;&nbsp; if (hMenu)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EnableMenuItem(hMenu,SC_CLOSE,bEnable ? MF_ENABLED : MF_GRAYED);</font><br><br>&nbsp; But when I apply skin for this form, the close button is not enable or disable as I expected (always enable or disable).<br><br>&nbsp;Plz help me,<br><br>&nbsp;Thanks a lot!<br>]]>
   </description>
   <pubDate>Mon, 06 Oct 2008 06:07:20 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=12341&amp;PID=41669&amp;title=disable-closex-button#41669</guid>
  </item> 
 </channel>
</rss>