+ if ( IsFrozen() )
+ {
+ // DoFreeze/DoThaw don't do anything if the window is not shown, so
+ // we have to call them from here now
+ if ( show )
+ DoFreeze();
+ else
+ DoThaw();
+ }
+
+ return true;
+}
+
+bool
+wxWindowMSW::MSWShowWithEffect(bool show,
+ wxShowEffect effect,
+ unsigned timeout)
+{
+ if ( effect == wxSHOW_EFFECT_NONE )
+ return Show(show);
+
+ if ( !wxWindowBase::Show(show) )
+ return false;
+
+ typedef BOOL (WINAPI *AnimateWindow_t)(HWND, DWORD, DWORD);
+
+ static AnimateWindow_t s_pfnAnimateWindow = NULL;
+ static bool s_initDone = false;
+ if ( !s_initDone )
+ {
+ wxDynamicLibrary dllUser32(wxT("user32.dll"), wxDL_VERBATIM | wxDL_QUIET);
+ wxDL_INIT_FUNC(s_pfn, AnimateWindow, dllUser32);
+
+ s_initDone = true;
+
+ // notice that it's ok to unload user32.dll here as it won't be really
+ // unloaded, being still in use because we link to it statically too
+ }
+
+ if ( !s_pfnAnimateWindow )
+ return Show(show);
+
+ // Show() has a side effect of sending a WM_SIZE to the window, which helps
+ // ensuring that it's laid out correctly, but AnimateWindow() doesn't do
+ // this so send the event ourselves
+ SendSizeEvent();
+
+ // prepare to use AnimateWindow()
+
+ if ( !timeout )
+ timeout = 200; // this is the default animation timeout, per MSDN
+
+ DWORD dwFlags = show ? 0 : AW_HIDE;
+
+ switch ( effect )
+ {
+ case wxSHOW_EFFECT_ROLL_TO_LEFT:
+ dwFlags |= AW_HOR_NEGATIVE;
+ break;
+
+ case wxSHOW_EFFECT_ROLL_TO_RIGHT:
+ dwFlags |= AW_HOR_POSITIVE;
+ break;
+
+ case wxSHOW_EFFECT_ROLL_TO_TOP:
+ dwFlags |= AW_VER_NEGATIVE;
+ break;
+
+ case wxSHOW_EFFECT_ROLL_TO_BOTTOM:
+ dwFlags |= AW_VER_POSITIVE;
+ break;
+
+ case wxSHOW_EFFECT_SLIDE_TO_LEFT:
+ dwFlags |= AW_SLIDE | AW_HOR_NEGATIVE;
+ break;
+
+ case wxSHOW_EFFECT_SLIDE_TO_RIGHT:
+ dwFlags |= AW_SLIDE | AW_HOR_POSITIVE;
+ break;
+
+ case wxSHOW_EFFECT_SLIDE_TO_TOP:
+ dwFlags |= AW_SLIDE | AW_VER_NEGATIVE;
+ break;
+
+ case wxSHOW_EFFECT_SLIDE_TO_BOTTOM:
+ dwFlags |= AW_SLIDE | AW_VER_POSITIVE;
+ break;
+
+ case wxSHOW_EFFECT_BLEND:
+ dwFlags |= AW_BLEND;
+ break;
+
+ case wxSHOW_EFFECT_EXPAND:
+ dwFlags |= AW_CENTER;
+ break;
+
+
+ case wxSHOW_EFFECT_MAX:
+ wxFAIL_MSG( wxT("invalid window show effect") );
+ return false;
+
+ default:
+ wxFAIL_MSG( wxT("unknown window show effect") );
+ return false;
+ }
+
+ if ( !(*s_pfnAnimateWindow)(GetHwnd(), timeout, dwFlags) )
+ {
+ wxLogLastError(wxT("AnimateWindow"));
+
+ return false;
+ }
+