The information in this article applies to:
SYMPTOMS
When a multiple document interface (MDI) child window processes the
WM_QUERYOPEN message to prevent the child from being restored out of a
minimized state, the system menu and restore button are not removed
from the menu bar when a maximized MDI child loses the focus or is
closed.
CAUSEWhen an MDI child is maximized, the system menu and restore button are added to the frame menu as bitmap menu items. When a maximized MDI child is destroyed or another MDI child is given the focus, the MDI child given the focus afterwards is maximized to replace the old MDI child. Windows cannot maximize an MDI child when it is processing the WM_QUERYOPEN message, and therefore the child is not maximized. Unfortunately, the system menu and restore button bitmaps are not removed from the menu bar. RESOLUTIONTo prevent this problem, restore the maximized MDI child before giving the focus to another child. MORE INFORMATIONIt may sometimes be desirable to prevent an MDI child from being restored during part or all of its life. This can be done by trapping the WM_QUERYOPEN message by placing the following code in the window procedure of the MDI child:
Unfortunately, this causes the added restore and system menu bitmaps
to remain on the menu bar when a maximized MDI child loses the focus
or is closed and the focus is given to a child processing this
message. The following code can be used to restore a maximized MDI
child when it loses the focus:
Additional query words:
Keywords : kbcode kbMDI kbNTOS kbWinOS2000 kbSDKWin32 kbGrpUser kbWinOS kbWndw |
Last Reviewed: January 25, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |