|
From: Sergey H. <se...@us...> - 2007-02-23 09:46:39
|
Update of /cvsroot/smartwin/SmartWin/include/smartwin In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv20912 Modified Files: MessageMap.h Log Message: Fixed bug #1598489 [Crash on fast switch] Index: MessageMap.h =================================================================== RCS file: /cvsroot/smartwin/SmartWin/include/smartwin/MessageMap.h,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- MessageMap.h 9 Dec 2006 22:06:11 -0000 1.26 +++ MessageMap.h 23 Feb 2007 09:46:35 -0000 1.27 @@ -365,7 +365,13 @@ } else if ( msg == WM_DRAWITEM && ( * idx )->handle() == reinterpret_cast< DRAWITEMSTRUCT * >( lPar )->hwndItem ) { - return ( * idx )->sendWidgetMessage( hWnd, msg, wPar, lPar ); + #ifndef WINCE + // Trick to fix BUG #1598489 + // During Fast-User-Switching ::GetForegroundWindows() returns NULL, + // And we should not try to draw on locked DC + if (::GetForegroundWindow() != NULL) + #endif + return ( * idx )->sendWidgetMessage( hWnd, msg, wPar, lPar ); } else if ( ( msg == WM_CTLCOLORSTATIC || |