<?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 : marquee progress ctrl on statusbar</title>
  <link>http://forum.codejock.com/</link>
  <description><![CDATA[This is an XML content feed of; Codejock Developer Community : Toolkit Pro : marquee progress ctrl on statusbar]]></description>
  <copyright>Copyright (c) 2006-2013 Web Wiz Forums - All Rights Reserved.</copyright>
  <pubDate>Tue, 21 Apr 2026 21:42:59 +0000</pubDate>
  <lastBuildDate>Mon, 29 Jun 2009 04:10:58 +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=14643</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[marquee progress ctrl on statusbar : I am trying to put progress control...]]></title>
   <link>http://forum.codejock.com/forum_posts.asp?TID=14643&amp;PID=50434&amp;title=marquee-progress-ctrl-on-statusbar#50434</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://forum.codejock.com/member_profile.asp?PF=3516">securigy</a><br /><strong>Subject:</strong> 14643<br /><strong>Posted:</strong> 29 June 2009 at 4:10am<br /><br />I am trying to put progress control on the status bar and am using the code from example Statusbar:<DIV>&nbsp;</DIV><FONT color=#0000ff size=2><FONT color=#0000ff size=2><P>int</FONT></FONT><FONT size=2> CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)</P><P>{</P><BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"><DIV>..............</DIV><DIV><DIV></DIV><FONT size=2>SetupStatusBarProgress();</DIV><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>return</FONT></FONT><FONT size=2> 0;</P></BLOCKQUOTE><P>}</P><DIV></DIV><P>&nbsp;</P><FONT color=#0000ff size=2><FONT color=#0000ff size=2><P>void</FONT></FONT><FONT size=2> CMainFrame::SetupStatusBarProgress()</P><P>{</P><BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"><P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// Create the edit control and add it to the status bar</P></FONT></FONT><FONT size=2><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>if</FONT></FONT><FONT size=2> (!m_ProgressCtrl.Create(WS_CHILD|WS_VISIBLE|PBS_SMOOTH,</P><P>CRect(0,0,0,0), &amp;m_wndStatusBar, 0))</P><P>{</P><BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"><P>TRACE0(</FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>"Failed to create edit control.\n"</FONT></FONT><FONT size=2>);</P><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>return</FONT></FONT><FONT size=2>;</P></BLOCKQUOTE><P>}</P><P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// add the indicator to the status bar.</P></FONT></FONT><FONT size=2><P>CXTPStatusBarPane* pPane = m_wndStatusBar.AddIndicator(ID_INDICATOR_PROG);</P><P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// Initialize the pane info and add the control.</P></FONT></FONT><FONT size=2><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>int</FONT></FONT><FONT size=2> nIndex = m_wndStatusBar.CommandToIndex(ID_INDICATOR_PROG);</P><P>ASSERT (nIndex != -1);</P><P>pPane-&gt;SetCaption(pPane-&gt;GetText());</P><P>pPane-&gt;SetText(_T(</FONT><FONT color=#a31515 size=2><FONT color=#a31515 size=2>""</FONT></FONT><FONT size=2>));</P><P>m_wndStatusBar.SetPaneWidth(nIndex, 150);</P><P>m_wndStatusBar.SetPaneStyle(nIndex, m_wndStatusBar.GetPaneStyle(nIndex) | SBPS_NOBORDERS);</P><P>m_wndStatusBar.AddControl(&amp;m_ProgressCtrl, ID_INDICATOR_PROG, FALSE);</P><P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// initialize progress control.</P></FONT></FONT><FONT size=2><P>m_ProgressCtrl.SetRange (0, 100);</P><P>m_ProgressCtrl.SetPos (0);</P><P>m_ProgressCtrl.SetStep (1);</P><P>pPane-&gt;SetCustomizationVisible(FALSE);</P></BLOCKQUOTE><P>}</P><DIV></DIV>then, before the long operation starts I call the following function that in normal circumstances produces marquee-style progress bar...<DIV></DIV><DIV></DIV><FONT color=#0000ff size=2><FONT color=#0000ff size=2><P>void</FONT></FONT><FONT size=2> CMainFrame::StartMarqueeProgress()</P><P>{</P><BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"><P>m_ProgressCtrl.ShowWindow(SW_SHOW);</P></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// Set the progress control style to PBS_MARQUEE</P></FONT></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>//</P></FONT></FONT><FONT size=2><P>HWND hWnd = m_ProgressCtrl.GetSafeHwnd();</P><P>LONG_PTR dwLong = GetWindowLongPtr(hWnd, GWL_STYLE);</P><P>LONG_PTR dwNewLong = dwLong | PBS_MARQUEE;</P><P>dwLong = SetWindowLongPtr(hWnd, GWL_STYLE, (LONG)dwNewLong);</P><P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// set progress control to blue</P></FONT></FONT><FONT size=2><P></FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>//</P></FONT></FONT><FONT size=2><P>DWORD dwColor;</P><P>CBluetoothControllerApp* pApp = (CBluetoothControllerApp*)AfxGetApp();</P><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>if</FONT></FONT><FONT size=2> (pApp-&gt;IsVista())</P><BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"><P>dwColor = RGB(0,255,0);</P></BLOCKQUOTE><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>else</P></FONT></FONT><FONT size=2><BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"><P>dwColor = GetSysColor(COLOR_ACTIVECAPTION);</P></BLOCKQUOTE><P>LRESULT lResult = m_ProgressCtrl.SendMessage(PBM_SETBARCOLOR, </FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// message ID</P></FONT></FONT><FONT size=2><BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"><BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"><BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"><BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"><BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"><BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"><BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"><BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"><P>0, </FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// must be 0</P></FONT></FONT><FONT size=2><P>dwColor); </FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// normal color</P></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></FONT></FONT><FONT size=2><P>DWORD dwTime;</P><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>if</FONT></FONT><FONT size=2> ( pApp-&gt;IsVista() )</P><BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"><P>dwTime = 10;</P></BLOCKQUOTE><P></FONT><FONT color=#0000ff size=2><FONT color=#0000ff size=2>else</P></FONT></FONT><FONT size=2><BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"><P>dwTime = 30;</P></BLOCKQUOTE><P>lResult = m_ProgressCtrl.SendMessage(</P><BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"><BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"><BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"><BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"><BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"><BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"><BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"><P>(UINT)PBM_SETMARQUEE, </FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// message ID</P></FONT></FONT><FONT size=2><P>(WPARAM)TRUE, </FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// set to marqee</P></FONT></FONT><FONT size=2><P>(LPARAM) dwTime); </FONT><FONT color=#008000 size=2><FONT color=#008000 size=2>// time in milisec between updates</P></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></BLOCKQUOTE></FONT></FONT><FONT size=2><P>}</P></FONT><DIV></DIV><DIV>I get no results... not only the marquee is not displayed, but nothing is displayed on the status bar... Anything I am doing wrong here?</DIV><DIV>&nbsp;</DIV></FONT></FONT></FONT>]]>
   </description>
   <pubDate>Mon, 29 Jun 2009 04:10:58 +0000</pubDate>
   <guid isPermaLink="true">http://forum.codejock.com/forum_posts.asp?TID=14643&amp;PID=50434&amp;title=marquee-progress-ctrl-on-statusbar#50434</guid>
  </item> 
 </channel>
</rss>