INFO: Updating the Application Status Bar on Demand

ID: Q98473


The information in this article applies to:
  • The Microsoft Foundation Classes (MFC), used with:
    • Microsoft Visual C++ for Windows, 16-bit edition, versions 1.0, 1.5, 1.51, 1.52
    • Microsoft Visual C++, 32-bit Editions, versions 1.0, 2.0, 2.1, 2.2, 4.0


SUMMARY

In an application developed with the Microsoft Foundation Classes (MFC), by default a status bar updates its panes only during idle processing.

An application can force a status bar to update its panes immediately by implementing an alternative to the idle processing mechanism. The application sends an update message to the status bar and then instructs the status bar to redraw its window. To update the status bar, send the WM_IDLEUPDATECMDUI message, discussed in MFC Tech Note #24, to the status bar then call the UpdateWindow() function. The sample code below demonstrates the member function to add to the CMainFrame window class.


MORE INFORMATION

Sample Code


   /*
    * Compile options needed: None
    */ 

   void CMainFrame::MyUpdatePane()
   {
      m_wndStatusBar.SendMessage(WM_IDLEUPDATECMDUI);
      m_wndStatusBar.UpdateWindow();
   } 

Additional query words:

Keywords : kbMFC kbStatBar KbUIDesign kbVC100 kbVC150 kbVC200 kbVC400 kbGrpMFCATL kbMFCCtrlBar
Version : winnt:1.0,2.0,2.1,2.2,4.0
Platform : winnt
Issue type : kbinfo


Last Reviewed: November 25, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.