<?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 : how to avoid blinking windows when invisible</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Report Control : how to avoid blinking windows when invisible]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Sat, 18 Apr 2026 14:25:54 +0000</pubDate>
  <lastBuildDate>Sun, 22 Mar 2009 09:14:41 +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=13754</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[how to avoid blinking windows when invisible :   void CRecordItemProgressEx...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=13754&amp;PID=46971&amp;title=how-to-avoid-blinking-windows-when-invisible#46971</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3565">jshan</a><br /><strong>Subject:</strong> 13754<br /><strong>Posted:</strong> 22 March 2009 at 9:14am<br /><br /><DIV><table width="99%"><tr><td><pre class="BBcode"></DIV><DIV>void CRecordItemProgressEx::OnDrawCaption(XTP_REPORTRECORDITEM_DRAWARGS* pDrawArgs, XTP_REPORTRECORDITEM_METRICS* pMetrics)<BR>{<BR>&nbsp;if(!(pDrawArgs &amp;&amp; pMetrics))<BR>&nbsp;&nbsp;return;<BR>&nbsp;// draw text<BR>&nbsp;CXTPReportRecordItemText::OnDrawCaption(pDrawArgs, pMetrics);</DIV><P>&nbsp;if(!m_bUseProgress)<BR>&nbsp;&nbsp;return;</P><P>&nbsp;CDC* pDC = pDrawArgs-&gt;pDC;<BR>&nbsp;CXTPFontDC font(pDC);<BR>&nbsp;CRect rcItem = pDrawArgs-&gt;rcItem;<BR>&nbsp;CXTPReportPaintManager* pPaintManager = pDrawArgs-&gt;pControl-&gt;GetPaintManager();<BR>&nbsp;<BR>&nbsp;rcItem.left -= 2;<BR>&nbsp;rcItem.right += 2;<BR>&nbsp;rcItem.top -= 1;<BR>&nbsp;rcItem.bottom += 1;</P><P>&nbsp;pDC-&gt;FillSolidRect(rcItem, m_bgColor);</P><P>//&nbsp;rcItem.bottom -= 1;<BR>//&nbsp;rcItem.left += 1;&nbsp;&nbsp;// leave margin in case row is highlighted<BR>// &nbsp;// draw border<BR>// &nbsp;pDC-&gt;Draw3dRect(&amp;rcItem, RGB(0,0,0), ::GetSysColor(COLOR_BTNSHADOW));</P><P>&nbsp;// draw progress bar and text<BR>&nbsp;CRect LeftRect, RightRect;<BR>&nbsp;RightRect = LeftRect = rcItem;</P><P>&nbsp;int w = (LeftRect.Width() * m_nProgress) / 100;<BR>&nbsp;LeftRect.right = LeftRect.left + w - 1;<BR>&nbsp;RightRect.left = LeftRect.right;</P><P>&nbsp;pDC-&gt;FillSolidRect(LeftRect, m_fgColor); // RGB(160, 32, 240)</P><P>&nbsp;if (m_strProgress != _T(""))<BR>&nbsp;{<BR>&nbsp;&nbsp;CString str;<BR>&nbsp;&nbsp;str.Format(_T("%s %d%%"), m_strProgress, m_nProgress);</P><P>&nbsp;&nbsp;pDC-&gt;SetBkMode(TRANSPARENT);</P><P>&nbsp;&nbsp;CRect TextRect;<BR>&nbsp;&nbsp;TextRect = rcItem;<BR>&nbsp;&nbsp;TextRect.DeflateRect(1, 1);<BR>&nbsp;&nbsp;font.SetFont(pPaintManager-&gt;GetTextFont());<BR>&nbsp;&nbsp;CRgn rgn;<BR>&nbsp;&nbsp;rgn.CreateRectRgn(LeftRect.left, LeftRect.top, LeftRect.right, LeftRect.bottom);<BR>&nbsp;&nbsp;pDC-&gt;SelectClipRgn(&amp;rgn);<BR>&nbsp;&nbsp;pDC-&gt;SetTextColor(RGB(255, 255, 255));<BR>&nbsp;&nbsp;pDC-&gt;DrawText(str, &amp;TextRect, DT_CENTER | DT_NOPREFIX | DT_SINGLELINE);<BR>&nbsp;&nbsp;rgn.DeleteObject();</P><P>&nbsp;&nbsp;rgn.CreateRectRgn(RightRect.left, RightRect.top, RightRect.right, RightRect.bottom);<BR>&nbsp;&nbsp;pDC-&gt;SelectClipRgn(&amp;rgn);<BR>&nbsp;&nbsp;pDC-&gt;SetTextColor(RGB(0, 0, 0));<BR>&nbsp;&nbsp;pDC-&gt;DrawText(str, &amp;TextRect, DT_CENTER | DT_NOPREFIX | DT_SINGLELINE);<BR>&nbsp;&nbsp;rgn.DeleteObject();</P><P>&nbsp;&nbsp;pDC-&gt;SelectClipRgn(NULL);<BR>&nbsp;}<BR>}</P><DIV></DIV></pre></td></tr></table> <DIV>&nbsp;</DIV><DIV>This is my progressbar routine.&nbsp; Actually, I added fancy fuction which can&nbsp;be able to&nbsp;draw&nbsp;some texts in the progress bar.</DIV><DIV>is this code kinda overshooting ? or is there any tunning point ?</DIV><DIV>&nbsp;</DIV><DIV>regards.</DIV><DIV>&nbsp;</DIV><DIV>P.S: not only Hiden state, but also when two or more progress bar in the report contrl are making Blinking.</DIV><DIV>(It's&nbsp;File transfer progress bars)</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Sun, 22 Mar 2009 09:14:41 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=13754&amp;PID=46971&amp;title=how-to-avoid-blinking-windows-when-invisible#46971</guid>
  </item> 
  <item>
   <title><![CDATA[how to avoid blinking windows when invisible : Hi.  I&amp;#039;m using ProgressBar...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=13754&amp;PID=46967&amp;title=how-to-avoid-blinking-windows-when-invisible#46967</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3565">jshan</a><br /><strong>Subject:</strong> 13754<br /><strong>Posted:</strong> 22 March 2009 at 3:02am<br /><br />Hi.<DIV>&nbsp;</DIV><DIV>I'm using ProgressBar ctrl in my report ctrl.</DIV><DIV>When the progressbar ctrl is working invisible like when minimized or underneath another window.</DIV><DIV>Whole system windows are&nbsp;terribly blinking with high cpu rates. Especially. when minimized.</DIV><DIV>&nbsp;</DIV><DIV>I borrowed the progressbar routine from your example code.</DIV><DIV>&nbsp;</DIV><DIV>How to avoid this things ?</DIV><DIV>&nbsp;</DIV><DIV>regards.</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Sun, 22 Mar 2009 03:02:14 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=13754&amp;PID=46967&amp;title=how-to-avoid-blinking-windows-when-invisible#46967</guid>
  </item> 
 </channel>
</rss>