Solved

Update Info on statusBar like DevStudio....

Posted on 1997-08-04
3
145 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
  • 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Title # Comments Views Activity
deburging in oracle form 12 105
while loop over for loop 7 115
modThree challenge 4 96
"Black Box" Testing of Control System Software 2 70
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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 an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

856 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