PRB: Statusbar Pane Text Disappears When MDI Child Window Open (166242)



The information in this article applies to:

  • The Microsoft Foundation Classes (MFC), when used with:
    • Microsoft Visual C++, 32-bit Editions 2.0
    • Microsoft Visual C++, 32-bit Editions 2.1
    • Microsoft Visual C++, 32-bit Editions 2.2
    • Microsoft Visual C++, 32-bit Editions 4.0
    • Microsoft Visual C++, 32-bit Editions 4.1
    • Microsoft Visual C++, 32-bit Enterprise Edition 4.2
    • Microsoft Visual C++, 32-bit Professional Edition 4.2
    • Microsoft Visual C++, 32-bit Enterprise Edition 5.0
    • Microsoft Visual C++, 32-bit Professional Edition 5.0
    • Microsoft Visual C++, 32-bit Enterprise Edition 6.0
    • Microsoft Visual C++, 32-bit Professional Edition 6.0
    • Microsoft Visual C++, 32-bit Learning Edition 6.0

This article was previously published under Q166242

SYMPTOMS

The text in a statusbar pane of a MDI application may disappear when a CMDIChildWnd window is open. This occurs if the Pane ID is 59142 (0xE706) and the Update UI handler is in the CMainFrame.

CAUSE

The ID 59142 is used internally in MFC as the ID for ID_INDICATOR_KANA. CFrameWnd has a default Update UI handler for this ID, and can replace user- defined behavior by intercepting UPDATE_COMMAND_UI messages before they are routed to the user-defined Update UI handler.

The following conditions are required to exhibit this problem:

  1. A new pane with an ID of 59142 is added to the status bar.
  2. The Update UI handler of the pane is only in the CMainFrame Class.
The framework searches the command route for Update UI handlers for the status bar panes. When a CMDIChildWnd derived class is open, the framework finds the update UI handler in this object before it gets to the CMainFrame class. The framework uses this handler to update the pane. Since the KANA lock key is unlocked on non-Japanese systems the pane is disabled and it is blank.

When no CMDIChildWnd windows are open the pane is updated according to the Update UI handler in the CMainFrame class. The framework will not find the standard handler in the CFrameWnd class since it searches the derived class message maps before the base class message maps.

RESOLUTION

The problem can be overcome by changing the ID of the pane, or by deriving a class from CMDIChildWnd and putting a custom Update UI handler for the pane there.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.

MORE INFORMATION

ID_INDICATOR_KANA is used to display the state of the KANA lock key (present on Japanese systems). The handler checks for the key and enables/ disables the pane depending on the state of the key. On non-Japanese versions this key is always unlocked.

Modification Type:MajorLast Reviewed:12/2/2003
Keywords:kbprb kbStatBar KbUIDesign KB166242