Solved

Update Info on statusBar like DevStudio....

Posted on 1997-08-04
3
140 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

743 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now