don't give errors if SetLayeredWindowAttributes() is not available (as is the case under Win95)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55893 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1131,15 +1131,23 @@ bool wxTopLevelWindowMSW::SetTransparent(wxByte alpha)
|
|||||||
{
|
{
|
||||||
#if wxUSE_DYNLIB_CLASS
|
#if wxUSE_DYNLIB_CLASS
|
||||||
typedef DWORD (WINAPI *PSETLAYEREDWINDOWATTR)(HWND, DWORD, BYTE, DWORD);
|
typedef DWORD (WINAPI *PSETLAYEREDWINDOWATTR)(HWND, DWORD, BYTE, DWORD);
|
||||||
static PSETLAYEREDWINDOWATTR pSetLayeredWindowAttributes = NULL;
|
static PSETLAYEREDWINDOWATTR
|
||||||
|
pSetLayeredWindowAttributes = (PSETLAYEREDWINDOWATTR)-1;
|
||||||
|
|
||||||
if ( pSetLayeredWindowAttributes == NULL )
|
if ( pSetLayeredWindowAttributes == (PSETLAYEREDWINDOWATTR)-1 )
|
||||||
{
|
{
|
||||||
wxDynamicLibrary dllUser32(_T("user32.dll"));
|
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)
|
pSetLayeredWindowAttributes = (PSETLAYEREDWINDOWATTR)
|
||||||
dllUser32.GetSymbol(wxT("SetLayeredWindowAttributes"));
|
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 == NULL )
|
|
||||||
|
if ( !pSetLayeredWindowAttributes )
|
||||||
return false;
|
return false;
|
||||||
#endif // wxUSE_DYNLIB_CLASS
|
#endif // wxUSE_DYNLIB_CLASS
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user