Show scrolling text in a status bar pane

This simple trick uses string pointer manipulation to give scrolling effect in a status bar. The code is not robust. It only demonstrates how it could be done.

1. Derive your own CMyStatusBar from CstatusBar.

2. In MainFrm.h, change the type of status bar as:

	CMyStatusBar m_wndStatusBar;

3. Also change the indicator array in MainFrm.cpp as:
	static UINT indicators[] =
		IDS_SCROLL_PANE,				//scrolling text

4. Add IDS_SCROLL_PANE in the string table with few blanks. The size of pane will depend on this blank string. There are other painfull ways of sizing a pane too.

5. Add following member to CMyStatusBar: Cstring m_strScrollText;

6. Add OnTimer() to the CMyStatusBar:

void CMyStatusBar::OnTimer(UINT nIDEvent) 
	// TODO: Add your message handler code here and/or call default
	if (m_strScrollText.IsEmpty())
		SetPaneText(CommandToIndex(IDS_SCROLL_PANE), "");
	static UINT str_idx = 0;        //offset into string
	//if end of string, return to top
	if (str_idx >= (UINT) (m_strScrollText.GetLength() / 2) - 1)
		str_idx = 0;
	//display string
	SetPaneText(CommandToIndex(IDS_SCROLL_PANE), ((LPCSTR) 
	//scroll one character
	str_idx = str_idx + 1;

7. Destroy timer:

void CMyStatusBar::OnDestroy() 
	// TODO: Add your message handler code here

8. Add a method to start scrolling text. This method must be called after the mainframe (and the status bar) has been constructed to display scrolling text. Perhaps from the CWinApp::InitInstance().

void CMyStatusBar::StartDisplay(void) 
	//set text for scrolling
	m_strScrollText = "   Hello! World.   "
		//to make it circular scroll
		m_strScrollText += m_strScrollText;
	VERIFY(SetTimer(1, 200, NULL) != 0);    //timer


  • GHD barato podría hacer la mejor cantidad de calor para adquirir el mejor efecto

    Posted by hanmeihm on 05/30/2013 03:19pm

    [url=]Planchas ghd[/url] Estas planchas rojas tienen un significado doble voltaje se puede obtener un rendimiento uniforme en todo el mundo ideal para cuando vas en sus viajes. Tambin con un sistema incorporado en el modo de suspensin tus alisadores poco a poco se empiezan a cerrar despus de 30 minutos de haber sido utilizado C que le ahorra la preocupacin de si est¢ o no les apag! [url=]Comprar ghd[/url] La plancha de barro sin duda sellar la cutcula del pelo que pasa en el que la consistencia f¢cil y brillante que le gustara, as como eliminar el rizo no es necesario, si usted decide aadir otras. Adem¢s, incluye una funcin susceptible de proteccin que lo hace inmediatamente despu¦s de apagar en realidad no acostumbrarse sobre media hora. [url=]GHD Plancha pelo[/url] La primera straightner ghd era b¢sicamente aos antes de la competitividad ltimos dos mil. Planchas para el pelo durante ese tiempo el peso placas de aluminio muy ligeros y un montn de sauna elegido como medida para encontrar la mejor apariencia. La clave en la parte trasera de la m¢s alta eficacia de su ghd era b¢sicamente la derecha abajo a varios elementos principales.

  • Jordan shoes mentioned Gene to buy the variety, a disunion of Nike

    Posted by TaddyGaffic on 04/20/2013 12:12pm

    The sole of shoes are made from high quality rubber material and come with the lining. One can easily search for Vans footwear in the various online stores where they are easily available at great discount prices. These come in almost an infinite amount of [url=]nike free uk[/url] color and are usually on the cheap side. Experts as well as the rights of employees in regards to the apple can annihilate the Nike Air Max For travel arrangements in developing abjection can be a acceptable accord added in comparison to they're prevention, nonetheless they do accommodate sports sports athletes while using high duke inside their profession. Bargain Nike Air Max 2009 aswell provides countless jobs inside the nations absolutely area it's hardly accessible to acquire a job. In Indonesia, for archetype nike air max 90, even acknowledging baby assets [url=]nike free run 3[/url] in barter for plan Air Max, however, Nike bargain shoes inside a aught bulk adaptation and utilisation of the circadian needs.. Nike Zoom Vapor VI Tour Men`s tennis shoe is a great shoe popular in the tennis courts. It has Fly wire upper for ultra support and light weight ability, it sits on a frame that gives extra heel support and contains a full-length durable rubber support and herring bone pattern. It also has extra traction for all surfaces of play.. Write a Shakespeare Sonnet without any effort! Express loving [url=]nike free uk[/url] feelings in a sonnet in Shakespeare's own words in 15 minutes. The rhyme scheme of a Sonnet is a,b,a,b,c,d,c,d,e,f,e,f,g,g. Think of a theme like "love" "death" or "deceit", then choose your lines in the rhyme pattern and put a Sonnet together using the programme

  • desktop

    Posted by Legacy on 08/05/1999 12:00am

    Originally posted by: atif

    do u know how to display on desktop client area not in application client area

    • Take a look!

      Posted by owuag on 12/03/2008 09:03pm


Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date