+ // After destroying an owned window, Windows activates the next top level
+ // window in Z order but it may be different from our owner (to reproduce
+ // this simply Alt-TAB to another application and back before closing the
+ // owned frame) whereas we always want to yield activation to our parent
+ //
+ if (HasFlag(wxFRAME_FLOAT_ON_PARENT))
+ {
+ wxWindow* pParent = GetParent();
+
+ if (pParent)
+ {
+ ::WinSetWindowPos( GetHwndOf(pParent)
+ ,HWND_TOP
+ ,0, 0, 0, 0
+ ,SWP_ZORDER
+ );
+ }
+ }
+
+ //
+ // If this is the last top-level window, we're going to exit and we should
+ // delete ms_hiddenParent now to avoid leaking it