+// ---------------------------------------------------------------------------
+
+bool wxTopLevelWindowMSW::SetTransparent(wxByte alpha)
+{
+#if wxUSE_DYNLIB_CLASS
+ typedef DWORD (WINAPI *PSETLAYEREDWINDOWATTR)(HWND, DWORD, BYTE, DWORD);
+ static PSETLAYEREDWINDOWATTR pSetLayeredWindowAttributes = NULL;
+
+ if ( pSetLayeredWindowAttributes == NULL )
+ {
+ wxDynamicLibrary dllUser32(_T("user32.dll"));
+ pSetLayeredWindowAttributes = (PSETLAYEREDWINDOWATTR)
+ dllUser32.GetSymbol(wxT("SetLayeredWindowAttributes"));
+ }
+ if ( pSetLayeredWindowAttributes == NULL )
+ 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()
+}
+
+