Solved

Update Info on statusBar like DevStudio....

Posted on 1997-08-04
3
146 Views
Last Modified: 2013-11-20
Hi!

  I have an application which doing some data loading for a few minutes. During this process I would like to show some information on status bar to let user see progress of loading( somethink like Displaying name of current loaded item and setting index of CProgreesBar). I have a loop which is doing all loading and I tried to use CStatusBar::SetWindowText and CStatusBarCtrl::SetText functions to display name of current item on status bar but it was empty. I would grateful for any help.
0
Comment
Question by:gelbert
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 15

Expert Comment

by:Tommy Hui
ID: 1303037
After you set the text, you'll need to let the operating system have some time to process the painting for the status control.

The best way to do that is to use a function like this:

BOOL TWaitingMessages::Pump()
{
      MSG msg;

      while (::PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE))
      {
            if (!AfxGetApp()->PumpMessage())
            {
                  ::PostQuitMessage(0);
                  return FALSE;
            }
      }

      LONG idle = 0;
/* If using MFC
      while (AfxGetApp()->OnIdle(idle++))
            ;
*/
      return TRUE;
}

Then right after, you use CStatusBar::SetWindowText(), make a call to TWaitingMessage::Pump() and check if the return value is FALSE. If so, then the user wants to quit.

0
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 100 total points
ID: 1303038
Oops, the above should have been the answer.
0
 
LVL 8

Author Comment

by:gelbert
ID: 1303039
Thank you.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question