+ case WM_COMMAND:
+ // system messages such as SC_CLOSE are sent as WM_COMMANDs to the
+ // parent MDI frame and we must let the DefFrameProc() have them
+ // for these commands to work (without it, closing the maximized
+ // MDI children doesn't work, for example)
+ {
+ WXWORD id, cmd;
+ WXHWND hwnd;
+ UnpackCommand(wParam, lParam, &id, &hwnd, &cmd);
+
+ if ( id == wxID_MDI_MORE_WINDOWS ||
+ (cmd == 0 /* menu */ &&
+ id >= SC_SIZE /* first system menu command */) )
+ {
+ MSWDefWindowProc(message, wParam, lParam);
+ processed = true;
+ }
+ else // Not a system command.
+ {
+ // Menu (and toolbar) events should be sent to the active
+ // child first and only be processed by the parent frame if
+ // they're not handled there.
+ if ( wxMDIChildFrame* child = GetActiveChild() )
+ {
+ processed = child->MSWHandleMessage(&rc,
+ message,
+ wParam,
+ lParam);
+ }
+ }
+ }
+ break;
+