diff --git a/include/wx/msw/frame.h b/include/wx/msw/frame.h index 410081887e..325f0acc51 100644 --- a/include/wx/msw/frame.h +++ b/include/wx/msw/frame.h @@ -141,6 +141,8 @@ protected: // window proc for the frames long MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam); + + virtual bool IsMDIChild() const { return FALSE; } bool m_iconized; WXHICON m_defaultIcon; diff --git a/include/wx/msw/mdi.h b/include/wx/msw/mdi.h index 385659df1c..891aaff8c5 100644 --- a/include/wx/msw/mdi.h +++ b/include/wx/msw/mdi.h @@ -174,6 +174,7 @@ protected: virtual void DoGetPosition(int *x, int *y) const; virtual void DoSetClientSize(int width, int height); virtual void InternalSetMenuBar(); + virtual bool IsMDIChild() const { return TRUE; } // common part of all ctors void Init(); diff --git a/src/msw/frame.cpp b/src/msw/frame.cpp index 501b0fe8b6..10ecf1553a 100644 --- a/src/msw/frame.cpp +++ b/src/msw/frame.cpp @@ -807,7 +807,7 @@ void wxFrame::IconizeChildFrames(bool bIconize) // the child MDI frames are a special case and should not be touched by // the parent frame - instead, they are managed by the user wxFrame *frame = wxDynamicCast(win, wxFrame); - if ( frame && !wxDynamicCast(frame, wxMDIChildFrame) ) + if ( frame && !frame->IsMDIChild() ) { frame->Iconize(bIconize); }