<?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 Button at Runtime</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Skin Framework : Disable Close Button at Runtime]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Mon, 25 May 2026 18:41:50 +0000</pubDate>
  <lastBuildDate>Wed, 23 Jan 2008 02:10:44 +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=9384</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 Button at Runtime : That didn&amp;#039;t work, but based...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=9384&amp;PID=30409&amp;title=disable-close-button-at-runtime#30409</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3543">pijnappel</a><br /><strong>Subject:</strong> 9384<br /><strong>Posted:</strong> 23 January 2008 at 2:10am<br /><br />That didn't work, but based on your answer I found the solution myself. I had to change the Window Style and then change it back to the old state to refresh the buttons. I chose the maximize button:<DIV>&nbsp;</DIV><DIV><DIV>AfxGetMainWnd()-&gt;ModifyStyle(WS_MAXIMIZEBOX, 0, SWP_FRAMECHANGED);<BR>AfxGetMainWnd()-&gt;ModifyStyle(0, WS_MAXIMIZEBOX, SWP_FRAMECHANGED);</DIV><DIV>&nbsp;</DIV><DIV>Regards</DIV><DIV>&nbsp;</DIV><DIV>Timo</DIV></DIV>]]>
   </description>
   <pubDate>Wed, 23 Jan 2008 02:10:44 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=9384&amp;PID=30409&amp;title=disable-close-button-at-runtime#30409</guid>
  </item> 
  <item>
   <title><![CDATA[Disable Close Button at Runtime : Hi,  Try call   SetWindowPos(0,...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=9384&amp;PID=30398&amp;title=disable-close-button-at-runtime#30398</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=6851">Oleg</a><br /><strong>Subject:</strong> 9384<br /><strong>Posted:</strong> 22 January 2008 at 3:40pm<br /><br />Hi,<DIV>&nbsp;</DIV><DIV>Try call </DIV><DIV>&nbsp;</DIV><DIV>SetWindowPos(0, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | <strong>SWP_FRAMECHANGED | SWP_NOACTIVATE | SWP_DRAWFRAME</strong>);<BR></DIV><DIV>after.</DIV>]]>
   </description>
   <pubDate>Tue, 22 Jan 2008 15:40:08 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=9384&amp;PID=30398&amp;title=disable-close-button-at-runtime#30398</guid>
  </item> 
  <item>
   <title><![CDATA[Disable Close Button at Runtime : I&amp;#039;m trying to disable the...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=9384&amp;PID=30393&amp;title=disable-close-button-at-runtime#30393</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3543">pijnappel</a><br /><strong>Subject:</strong> 9384<br /><strong>Posted:</strong> 22 January 2008 at 10:32am<br /><br />I'm trying to disable the Close Button of the window frame in runtime using the following code:<DIV>&nbsp;</DIV><FONT color=#010001 size=2><P><FONT face="Arial, Helvetica, sans-serif">void EnableCloseButton</FONT></FONT><FONT face="Arial, Helvetica, sans-serif"><FONT size=2>(</FONT><FONT color=#010001 size=2>BOOL</FONT><FONT size=2> </FONT><FONT color=#010001 size=2>bEnable</FONT></FONT><FONT size=2><FONT face="Arial, Helvetica, sans-serif">)</FONT></P><DIV><FONT face="Arial, Helvetica, sans-serif">{</FONT></DIV><P></FONT><FONT face="Arial, Helvetica, sans-serif"><FONT color=#010001 size=2>UINT</FONT><FONT size=2> </FONT><FONT color=#010001 size=2>menuf</FONT><FONT size=2> = </FONT><FONT color=#010001 size=2>bEnable</FONT><FONT size=2> ? (</FONT><FONT color=#010001 size=2>MF_BYCOMMAND</FONT><FONT size=2>) : (</FONT><FONT color=#010001 size=2>MF_BYCOMMAND</FONT></FONT><FONT size=2><FONT face="Arial, Helvetica, sans-serif"> | </FONT><FONT color=#010001 size=2></P><P><FONT face="Arial, Helvetica, sans-serif">MF_GRAYED </FONT></FONT></FONT><FONT face="Arial, Helvetica, sans-serif" color=#010001 size=2>| MF_DISABLED</FONT><FONT size=2><FONT face="Arial, Helvetica, sans-serif">);</FONT></P><P></FONT><FONT face="Arial, Helvetica, sans-serif"><FONT color=#010001 size=2>CMenu</FONT><FONT size=2>* </FONT><FONT color=#010001 size=2>pSM</FONT><FONT size=2> = </FONT><FONT color=#010001 size=2>GetSystemMenu</FONT><FONT size=2>(</FONT><FONT color=#010001 size=2>FALSE</FONT></FONT><FONT size=2><FONT face="Arial, Helvetica, sans-serif">);</FONT></P><P></FONT><FONT face="Arial, Helvetica, sans-serif"><FONT color=#0000ff size=2>if</FONT><FONT size=2>(</FONT><FONT color=#010001 size=2>pSM</FONT></FONT><FONT size=2><FONT face="Arial, Helvetica, sans-serif">)</FONT></P><P><FONT face="Arial, Helvetica, sans-serif">{</FONT></P><P></FONT><FONT face="Arial, Helvetica, sans-serif"><FONT color=#010001 size=2>pSM</FONT><FONT size=2>-&gt;</FONT><FONT color=#010001 size=2>EnableMenuItem</FONT><FONT size=2>(</FONT><FONT color=#010001 size=2>SC_CLOSE</FONT><FONT size=2>, </FONT><FONT color=#010001 size=2>menuf</FONT></FONT><FONT size=2><FONT face="Arial, Helvetica, sans-serif">);</FONT></P><P><FONT face="Arial, Helvetica, sans-serif">}</P><DIV></DIV><DIV>}</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV><DIV>I call this function on a button click. It works for a dialog based test application. In my application project based on <FONT color=#010001 size=2>CXTPDialogBase</FONT><FONT size=2>&lt;</FONT><FONT color=#010001 size=2>CXTResizeDialog</FONT><FONT size=2>&gt; the button is not disabled. When I maximize it the new style i applied to the button.</FONT></DIV><DIV>&nbsp;</DIV><DIV>Is there a workaround for this problem?</DIV><DIV>Thanks,</DIV><DIV>&nbsp;</DIV><DIV>Timo</FONT></FONT></DIV>]]>
   </description>
   <pubDate>Tue, 22 Jan 2008 10:32:52 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=9384&amp;PID=30393&amp;title=disable-close-button-at-runtime#30393</guid>
  </item> 
 </channel>
</rss>