- wxFrame *frame = wxDynamicCast(win, wxFrame);
- if ( frame && !frame->IsMDIChild() )
+ wxFrameMSW *frame = wxDynamicCast(win, wxFrameMSW);
+ if ( frame
+#if wxUSE_MDI_ARCHITECTURE
+ && !wxDynamicCast(frame, wxMDIChildFrame)
+#endif // wxUSE_MDI_ARCHITECTURE
+ )