+WXHWND wxTopLevelWindowMSW::MSWGetParent() const
+{
+ // for the frames without wxFRAME_FLOAT_ON_PARENT style we should use NULL
+ // parent HWND or it would be always on top of its parent which is not what
+ // we usually want (in fact, we only want it for frames with the
+ // wxFRAME_FLOAT_ON_PARENT flag)
+ wxWindow *parent;
+ if ( HasFlag(wxFRAME_FLOAT_ON_PARENT) )
+ {
+ parent = GetParent();
+
+ // this flag doesn't make sense then and will be ignored
+ wxASSERT_MSG( parent,
+ _T("wxFRAME_FLOAT_ON_PARENT but no parent?") );
+ }
+ else // don't float on parent, must not be owned
+ {
+ parent = NULL;
+ }
+
+ // now deal with the 2nd taskbar-related problem (see comments above in
+ // MSWGetStyle())
+ if ( HasFlag(wxFRAME_NO_TASKBAR) && !parent )
+ {
+ if ( !ms_hiddenParent )
+ {
+ ms_hiddenParent = new wxTopLevelWindowMSW(NULL, -1, _T(""));
+
+ // we shouldn't leave it in wxTopLevelWindows or we wouldn't
+ // terminate the app when the last user-created frame is deleted --
+ // see ~wxTopLevelWindowMSW
+ wxTopLevelWindows.DeleteObject(ms_hiddenParent);
+ }
+
+ parent = ms_hiddenParent;
+ }
+
+ return parent ? parent->GetHWND() : WXHWND(NULL);
+}
+