<?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 : Problems with WM_UPDATEUISTATE</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Task Panel : Problems with WM_UPDATEUISTATE]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 13 May 2026 14:31:33 +0000</pubDate>
  <lastBuildDate>Wed, 05 Dec 2012 15:02:17 +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=20389</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[Problems with WM_UPDATEUISTATE : For a long time I have struggled...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=20389&amp;PID=69358&amp;title=problems-with-wm-updateuistate#69358</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3213">rdhd</a><br /><strong>Subject:</strong> 20389<br /><strong>Posted:</strong> 05 December 2012 at 3:02pm<br /><br />For a long time I have struggled with MFC dialog boxes that we insert into a task panel group that has buttons on it. We use the CXTButton class and the issue I have is with the focus rectangle not drawing or with inconsistent drawing.<br /><br />I have found that previously that the UISF_HIDEFOCUS flag gets cleared and so my "fix" is to try and isolate a good code location to send the WM_UPDATEUISTATE message to the button using MAKEWPARAM(UIS_CLEAR, UISF_HIDEFOCUS)  and a 0 LPARAM. That clears the bit. This has mostly worked but now with the version 15.1.3, I am having the issue again.<br /><br />So in my OnEraseBkgnd handler, I do this:<br /><br />SendMessage(WM_UPDATEUISTATE, MAKEWPARAM(UIS_CLEAR, UISF_HIDEFOCUS), 0);<br /><br />TO make matters worse, I have previously found that on some machines, when I do that, another display is immediately initiated so I wrapped the code up to stop the display chain:<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;static int s_UpdatingUIState = 0;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if( 0 == s_UpdatingUIState )<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s_UpdatingUIState = 1;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;SendMessage(WM_UPDATEUISTATE, MAKEWPARAM(UIS_CLEAR, UISF_HIDEFOCUS), 0);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;s_UpdatingUIState = 0;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br /><br />That was working but now it is not working. Again I am in a constant state of displays unless I remove that code.<br /><br />So I searched the CJ code base we have an I see that CodeJock now has two XTButton.cpp files. One is in Controls\Deprecated\XTButton.cpp and the other in Controls\Button\XTPButton.cpp.<br /><br />I set a break in both and I see that we are using the "deprecated" one. Also, in the deprecated code, I see CJ calling Inalidate(FALSE) while in the other file (non-deprecated) I see CJ calling RedrawButton.<br /><br />So, I have a some questions for the CodeJock developers. <br /><br />Why did you change the CXTButton:LOnUpdateUIState code to call RedrawButton when this message handler is called?<br /><br />Should I be doing something to make sure I am not using the "deprecated" source file?<br /><br />How might the focus rect display keep getting turned off?]]>
   </description>
   <pubDate>Wed, 05 Dec 2012 15:02:17 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=20389&amp;PID=69358&amp;title=problems-with-wm-updateuistate#69358</guid>
  </item> 
 </channel>
</rss>