INFO: Updating the Application Status Bar on Demand

Last reviewed: October 10, 1997
Article ID: Q98473
The information in this article applies to:
  • The Microsoft Foundation Classes (MFC) included with: - Microsoft Visual C++ for Windows, versions 1.0, 1.5, 1.51, 1.52 - Microsoft Visual C++ 32-bit Edition, 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();
   }
Keywords          : MfcUI kbinfo
Technology        : kbmfc
Version           : 1.0 1.5 1.51 1.52 2.0
Platform          : NT WINDOWS


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


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.

Last reviewed: October 10, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.