KnowledgeBase Archive

An Archive of Early Microsoft KnowledgeBase Articles

View on GitHub

Q98473: INFO: Updating the Application Status Bar on Demand

Article: Q98473
Product(s): Microsoft C Compiler
Version(s): winnt:1.0,2.0,2.1,2.2,4.0
Operating System(s): 
Keyword(s): kbMFC kbStatBar KbUIDesign kbVC100 kbVC150 kbVC200 kbVC400 kbGrpDSMFCATL kbMFCCtrlBar
Last Modified: 07-MAY-2001

-------------------------------------------------------------------------------
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 kbGrpDSMFCATL kbMFCCtrlBar 
Technology        : kbAudDeveloper kbMFC
Version           : winnt:1.0,2.0,2.1,2.2,4.0
Issue type        : kbinfo

=============================================================================

THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Copyright Microsoft Corporation 1986-2002.