Microsoft KB Archive/166242

= PRB: Statusbar Pane Text Disappears When MDI Child Window Open =

Article ID: 166242

Article Last Modified on 11/21/2006

-

APPLIES TO

 Microsoft Foundation Class Library 4.2, when used with:  Microsoft Visual C++ 2.0 Professional Edition

 Microsoft Visual C++ 2.1

 Microsoft Visual C++ 2.2

 Microsoft Visual C++ 4.0 Standard Edition</li></ul>

 Microsoft Visual C++ 4.1 Subscription</li></ul>

 Microsoft Visual C++ 4.2 Enterprise Edition</li></ul>

 Microsoft Visual C++ 4.2 Professional Edition</li></ul>

 Microsoft Visual C++ 5.0 Enterprise Edition</li></ul>

 Microsoft Visual C++ 5.0 Professional Edition</li></ul>

 Microsoft Visual C++ 6.0 Enterprise Edition</li></ul>

 Microsoft Visual C++ 6.0 Professional Edition</li></ul>

 Microsoft Visual C++ 6.0 Standard Edition</li></ul> </li></ul>

-

<div class="notice_section">

This article was previously published under Q166242

<div class="symptoms_section">

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.

<div class="cause_section">

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.

<div class="resolution_section">

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.

<div class="status_section">

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

<div class="moreinformation_section">

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.

Additional query words: 3.0 3.1 3.2 CStatusBar

Keywords: kbprb kbstatbar kbuidesign KB166242

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.