From f25fe9222dca07d3a3a43feada1825387baa4866 Mon Sep 17 00:00:00 2001 From: Pritpal Bedi Date: Tue, 13 Jan 2009 15:22:27 +0000 Subject: [PATCH] 2009-01-13 07:17 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * harbour/contrib/gtwvg/gtwvg.c ! Synchronized with GTWVT as per change below ( Przemek ): + Added 'layered' window support. It's enabled on W2K and above (and only when not in Terminal Services environment, because it makes it perform worse). This way the screen is also properly displayed regardless of what the Harbour application does. It also fixes numerous paint artifacts, when GTWVT window was in the background and another window is moved in front of it. --- harbour/ChangeLog | 12 ++++++++++++ harbour/contrib/gtwvg/gtwvg.c | 29 +++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index f0de4f410a..34cb231ea4 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,18 @@ 2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2009-01-13 07:17 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) + * harbour/contrib/gtwvg/gtwvg.c + ! Synchronized with GTWVT as per change below ( Przemek ): + + Added 'layered' window support. It's enabled on W2K + and above (and only when not in Terminal Services + environment, because it makes it perform worse). This + way the screen is also properly displayed regardless + of what the Harbour application does. It also fixes + numerous paint artifacts, when GTWVT window was in + the background and another window is moved in front + of it. + 2009-01-13 14:07 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/common.mak * harbour/source/rtl/Makefile diff --git a/harbour/contrib/gtwvg/gtwvg.c b/harbour/contrib/gtwvg/gtwvg.c index 048738b8f7..821eb80254 100644 --- a/harbour/contrib/gtwvg/gtwvg.c +++ b/harbour/contrib/gtwvg/gtwvg.c @@ -2168,6 +2168,35 @@ static BOOL hb_gt_wvt_CreateConsoleWindow( PHB_GTWVT pWVT ) if( !pWVT->hWnd ) hb_errInternal( 10001, "Failed to create WVT window", NULL, NULL ); + if( ! GetSystemMetrics( SM_REMOTESESSION ) ) + { + typedef BOOL ( WINAPI * P_SLWA )( HWND, COLORREF, BYTE, DWORD ); + +#if defined(HB_WINCE) + P_SLWA pSetLayeredWindowAttributes = ( P_SLWA ) + GetProcAddress( GetModuleHandle( TEXT( "user32.dll" ) ), + TEXT( "SetLayeredWindowAttributes" ) ); +#else + P_SLWA pSetLayeredWindowAttributes = ( P_SLWA ) + GetProcAddress( GetModuleHandle( TEXT( "user32.dll" ) ), + "SetLayeredWindowAttributes" ); +#endif + + if( pSetLayeredWindowAttributes ) + { +#if (defined(_MSC_VER) && (_MSC_VER <= 1200 || defined(HB_WINCE)) || defined(__DMC__)) && !defined(HB_ARCH_64BIT) + SetWindowLong( pWVT->hWnd, GWL_EXSTYLE, GetWindowLong( pWVT->hWnd, GWL_EXSTYLE ) | WS_EX_LAYERED ); +#else + SetWindowLongPtr( pWVT->hWnd, GWL_EXSTYLE, GetWindowLongPtr( pWVT->hWnd, GWL_EXSTYLE ) | WS_EX_LAYERED ); +#endif + + pSetLayeredWindowAttributes( pWVT->hWnd, + ( COLORREF ) 0 /* COLORREF crKey */, + 255 /* BYTE bAlpha */, + LWA_ALPHA /* DWORD dwFlags */ ); + } + } + hb_gt_wvt_InitWindow( pWVT, pWVT->ROWS, pWVT->COLS ); /* Set icon */ if( pWVT->hIcon )