<?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 : CXTPButtonTheme and drawing the focus rect</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Controls : CXTPButtonTheme and drawing the focus rect]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Wed, 13 May 2026 04:43:32 +0000</pubDate>
  <lastBuildDate>Thu, 26 Jun 2008 09:25: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=11008</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[CXTPButtonTheme and drawing the focus rect : Make that a WM_UPDATEUISTATE instead...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11008&amp;PID=37432&amp;title=cxtpbuttontheme-and-drawing-the-focus-rect#37432</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3213">rdhd</a><br /><strong>Subject:</strong> 11008<br /><strong>Posted:</strong> 26 June 2008 at 9:25am<br /><br />Make that a WM_UPDATEUISTATE instead of WM_CHANGEUISTATE. The latter causes windows to send the same message to all the windows in my process.]]>
   </description>
   <pubDate>Thu, 26 Jun 2008 09:25:54 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11008&amp;PID=37432&amp;title=cxtpbuttontheme-and-drawing-the-focus-rect#37432</guid>
  </item> 
  <item>
   <title><![CDATA[CXTPButtonTheme and drawing the focus rect : I have found that I can do this...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11008&amp;PID=36743&amp;title=cxtpbuttontheme-and-drawing-the-focus-rect#36743</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3213">rdhd</a><br /><strong>Subject:</strong> 11008<br /><strong>Posted:</strong> 14 June 2008 at 2:47pm<br /><br /><P>I have found that I can do this to a dialog box to get rid of the no focus style:</P><FONT size=2><P>SendMessage</FONT><FONT size=2>( </FONT><FONT size=2>WM_CHANGEUISTATE</FONT><FONT size=2>,</FONT><FONT size=2> MAKELONG</FONT><FONT size=2>( </FONT><FONT size=2>UIS_CLEAR</FONT><FONT size=2>,</FONT><FONT size=2> UISF_HIDEFOCUS </FONT><FONT size=2>),</FONT><FONT size=2> </FONT><FONT size=2>0 );</P><DIV><DIV><P>I still don't know what sets the UI state so the no focus state exists but at least I can zap the thing.<img src="https://forum.codejock.com/smileys/smiley1.gif" border="0"></FONT></P></DIV></DIV>]]>
   </description>
   <pubDate>Sat, 14 Jun 2008 14:47:27 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11008&amp;PID=36743&amp;title=cxtpbuttontheme-and-drawing-the-focus-rect#36743</guid>
  </item> 
  <item>
   <title><![CDATA[CXTPButtonTheme and drawing the focus rect : I have a button subclassed from...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=11008&amp;PID=36623&amp;title=cxtpbuttontheme-and-drawing-the-focus-rect#36623</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3213">rdhd</a><br /><strong>Subject:</strong> 11008<br /><strong>Posted:</strong> 12 June 2008 at 1:03pm<br /><br /><DIV>I have a button subclassed from the CXTButton. I set the style using SetXButtonStyle to <FONT size=2><P>BS_XT_WINXP_COMPAT</FONT><FONT color=#0000ff size=2>|</FONT><FONT size=2>BS_XT_HILITEPRESSED</FONT><FONT color=#0000ff size=2>|</FONT><FONT size=2>BS_XT_TWOROWS</FONT><FONT color=#0000ff size=2>|</FONT><FONT size=2>BS_XT_SHOWFOCUS</P></FONT></DIV><DIV>When asked to display a button with focus, sometimes I get the focus rect drawn and sometimes not. Stepping thru the button theme drawing code I see that when it fails to draw, the ODS_NOFOCUSRECT style bit is set in the input item structure (ODS_FOCUS is set - the ODS style is 0x310). I also verified that this happens on the same&nbsp;same button ("this" is the same so it is not another button object).</DIV><DIV>&nbsp;</DIV><DIV><FONT size=2>Also, once the focus draws (the ODS_NOFOCUSRECT bit is not set), from then on the button will draw with focus anytime I set focus to the button.</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>So far, the most reliable way for me to get that style removed is to tab to the button (SetFocus is called) and then hit the spacebar. The button presses and from then on when I tab to the button the rect draws.</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>In order to "fix" this, I overrode DrawItem and zap that bit and then send the call to CXTButton. That seems like a kludge to me.</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2>My only questions are:</FONT></DIV><DIV><FONT size=2></FONT>&nbsp;</DIV><DIV><FONT size=2><DIV>How does the <FONT size=2>ODS_NOFOCUSRECT style gets set in the owner draw structure to begin with?</FONT></DIV><DIV>&nbsp;</DIV><DIV>What would cause it to disappear?</DIV></DIV></FONT>]]>
   </description>
   <pubDate>Thu, 12 Jun 2008 13:03:07 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=11008&amp;PID=36623&amp;title=cxtpbuttontheme-and-drawing-the-focus-rect#36623</guid>
  </item> 
 </channel>
</rss>