+// ---------------------------------------------------------------------------
+
+bool wxTopLevelWindowMSW::SetTransparent(wxByte alpha)
+{
+#if wxUSE_DYNLIB_CLASS
+ typedef DWORD (WINAPI *PSETLAYEREDWINDOWATTR)(HWND, DWORD, BYTE, DWORD);
+ static PSETLAYEREDWINDOWATTR
+ pSetLayeredWindowAttributes = (PSETLAYEREDWINDOWATTR)-1;
+
+ if ( pSetLayeredWindowAttributes == (PSETLAYEREDWINDOWATTR)-1 )
+ {
+ wxDynamicLibrary dllUser32(_T("user32.dll"));
+
+ // use RawGetSymbol() and not GetSymbol() to avoid error messages under
+ // Windows 95: there is nothing the user can do about this anyhow
+ pSetLayeredWindowAttributes = (PSETLAYEREDWINDOWATTR)
+ dllUser32.RawGetSymbol(wxT("SetLayeredWindowAttributes"));
+
+ // it's ok to destroy dllUser32 here, we link statically to user32.dll
+ // anyhow so it won't be unloaded
+ }
+
+ if ( !pSetLayeredWindowAttributes )
+ return false;
+#endif // wxUSE_DYNLIB_CLASS
+
+ LONG exstyle = GetWindowLong(GetHwnd(), GWL_EXSTYLE);
+
+ // if setting alpha to fully opaque then turn off the layered style
+ if (alpha == 255)
+ {
+ SetWindowLong(GetHwnd(), GWL_EXSTYLE, exstyle & ~WS_EX_LAYERED);
+ Refresh();
+ return true;
+ }
+
+#if wxUSE_DYNLIB_CLASS
+ // Otherwise, set the layered style if needed and set the alpha value
+ if ((exstyle & WS_EX_LAYERED) == 0 )
+ SetWindowLong(GetHwnd(), GWL_EXSTYLE, exstyle | WS_EX_LAYERED);
+
+ if ( pSetLayeredWindowAttributes(GetHwnd(), 0, (BYTE)alpha, LWA_ALPHA) )
+ return true;
+#endif // wxUSE_DYNLIB_CLASS
+
+ return false;
+}
+
+bool wxTopLevelWindowMSW::CanSetTransparent()
+{
+ // The API is available on win2k and above
+
+ static int os_type = -1;
+ static int ver_major = -1;
+
+ if (os_type == -1)
+ os_type = ::wxGetOsVersion(&ver_major);
+
+ return (os_type == wxOS_WINDOWS_NT && ver_major >= 5);
+}
+
+
+void wxTopLevelWindowMSW::DoFreeze()
+{
+ // do nothing: freezing toplevel window causes paint and mouse events
+ // to go through it any TLWs under it, so the best we can do is to freeze
+ // all children -- and wxWindowBase::Freeze() does that
+}
+
+void wxTopLevelWindowMSW::DoThaw()
+{
+ // intentionally empty -- see DoFreeze()
+}
+
+