Solved

Update Info on statusBar like DevStudio....

Posted on 1997-08-04
3
147 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
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.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

695 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