-// on supported windows systems (Win2000 and greater, Mac), this function
-// will make a frame window transparent by a certain amount
-static void MakeWindowTransparent(wxWindow* wnd, int amount)
-{
-#if defined(__WXMSW__)
- // this API call is not in all SDKs, only the newer ones, so
- // we will runtime bind this
- typedef DWORD (WINAPI *PSETLAYEREDWINDOWATTR)(HWND, DWORD, BYTE, DWORD);
- static PSETLAYEREDWINDOWATTR pSetLayeredWindowAttributes = NULL;
- static HMODULE h = NULL;
- HWND hwnd = (HWND)wnd->GetHWND();
-
- if (!h)
- h = LoadLibrary(_T("user32"));
-
- if (!pSetLayeredWindowAttributes)
- {
- pSetLayeredWindowAttributes =
- (PSETLAYEREDWINDOWATTR)GetProcAddress(h,
-#ifdef __WXWINCE__
- wxT("SetLayeredWindowAttributes")
-#else
- "SetLayeredWindowAttributes"
-#endif
- );
- }
-
- if (pSetLayeredWindowAttributes == NULL)
- return;
-
- LONG exstyle = GetWindowLong(hwnd, GWL_EXSTYLE);
- if (0 == (exstyle & 0x80000) /*WS_EX_LAYERED*/)
- SetWindowLong(hwnd, GWL_EXSTYLE, exstyle | 0x80000 /*WS_EX_LAYERED*/);
-
- pSetLayeredWindowAttributes(hwnd, 0, (BYTE)amount, 2 /*LWA_ALPHA*/);
-
-#elif defined(__WXMAC__)
-
- WindowRef handle = GetControlOwner((OpaqueControlRef*)wnd->GetHandle());
- SetWindowAlpha(handle, float(amount)/ 255.0);
-
-#else
- wxUnusedVar(wnd);
- wxUnusedVar(amount);
-#endif
-}
-
-