From 290be7f0e087d31eb37232dea49c12f3c077ef7d Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 16 Jul 2011 14:00:32 +0000 Subject: [PATCH] 2011-07-16 15:59 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * src/rtl/gtwvt/gtwvt.c * contrib/gtwvg/gtwvg.c ! fixed to use LONG instead of DWORD for GetWindowLong() values ! fixed to use LONG_PTR instead of LONG for GetWindowLongPtr() values on systems requiring it, f.e. win64 builds ; review me pls ; TODO: GTWVG would have to be synced with recent GTWVT changes --- harbour/ChangeLog | 9 +++++++++ harbour/contrib/gtwvg/gtwvg.c | 28 ++++++++++++++-------------- harbour/src/rtl/gtwvt/gtwvt.c | 26 +++++++++++++++----------- 3 files changed, 38 insertions(+), 25 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 03b819ef43..660bcfd599 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,15 @@ The license applies to all entries newer than 2009-04-28. */ +2011-07-16 15:59 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * src/rtl/gtwvt/gtwvt.c + * contrib/gtwvg/gtwvg.c + ! fixed to use LONG instead of DWORD for GetWindowLong() values + ! fixed to use LONG_PTR instead of LONG for GetWindowLongPtr() values + on systems requiring it, f.e. win64 builds + ; review me pls + ; TODO: GTWVG would have to be synced with recent GTWVT changes + 2011-07-16 14:56 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbmlzo/core.c ! fixed to use hb_storns() instead of hb_storni() to make win64 diff --git a/harbour/contrib/gtwvg/gtwvg.c b/harbour/contrib/gtwvg/gtwvg.c index 22ab7c06c5..6da49fc3b0 100644 --- a/harbour/contrib/gtwvg/gtwvg.c +++ b/harbour/contrib/gtwvg/gtwvg.c @@ -116,9 +116,9 @@ static HB_CRITICAL_NEW( s_wvtMtx ); # ifndef SetWindowLongPtr # define SetWindowLongPtr SetWindowLong # endif -#define WVT_DWORD_LONG_PTR DWORD +# define HB_GTWVT_LONG_PTR LONG #else -#define WVT_DWORD_LONG_PTR LONG_PTR +# define HB_GTWVT_LONG_PTR LONG_PTR #endif #ifndef WS_OVERLAPPEDWINDOW @@ -2678,8 +2678,8 @@ static HB_BOOL hb_gt_wvt_FullScreen( PHB_GT pGT ) { PHB_GTWVT pWVT; RECT rt; - DWORD dwStyle; - DWORD dwExtendedStyle; + HB_GTWVT_LONG_PTR nStyle; + HB_GTWVT_LONG_PTR nExtendedStyle; #ifdef MONITOR_DEFAULTTONEAREST HMONITOR mon; MONITORINFO mi; @@ -2691,16 +2691,16 @@ static HB_BOOL hb_gt_wvt_FullScreen( PHB_GT pGT ) pWVT = HB_GTWVT_GET( pGT ); - dwStyle = GetWindowLongPtr( pWVT->hWnd, GWL_STYLE ); - dwExtendedStyle = GetWindowLongPtr( pWVT->hWnd, GWL_EXSTYLE ); + nStyle = GetWindowLongPtr( pWVT->hWnd, GWL_STYLE ); + nExtendedStyle = GetWindowLongPtr( pWVT->hWnd, GWL_EXSTYLE ); if( pWVT->bFullScreen ) { - dwStyle |= WS_CAPTION | WS_BORDER; - dwExtendedStyle |= WS_EX_TOPMOST; + nStyle |= WS_CAPTION | WS_BORDER; + nExtendedStyle |= WS_EX_TOPMOST; if( pWVT->bResizable ) - dwStyle |= WS_THICKFRAME; + nStyle |= WS_THICKFRAME; pWVT->MarginLeft = 0; pWVT->MarginTop = 0; @@ -2708,15 +2708,15 @@ static HB_BOOL hb_gt_wvt_FullScreen( PHB_GT pGT ) } else { - dwStyle &= ~( WS_CAPTION | WS_BORDER | WS_THICKFRAME ); - dwExtendedStyle &= ~WS_EX_TOPMOST; + nStyle &= ~( WS_CAPTION | WS_BORDER | WS_THICKFRAME ); + nExtendedStyle &= ~WS_EX_TOPMOST; pWVT->bMaximized = HB_FALSE; pWVT->bFullScreen = HB_TRUE; } - SetWindowLongPtr( pWVT->hWnd, GWL_STYLE, dwStyle ); - SetWindowLongPtr( pWVT->hWnd, GWL_EXSTYLE, dwExtendedStyle ); + SetWindowLongPtr( pWVT->hWnd, GWL_STYLE, nStyle ); + SetWindowLongPtr( pWVT->hWnd, GWL_EXSTYLE, nExtendedStyle ); if( ! pWVT->bFullScreen ) { @@ -3453,7 +3453,7 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo ) pWVT->bResizable = bNewValue; if( pWVT->hWnd ) { - WVT_DWORD_LONG_PTR style = GetWindowLongPtr( pWVT->hWnd, GWL_STYLE ); + HB_GTWVT_LONG_PTR style = GetWindowLongPtr( pWVT->hWnd, GWL_STYLE ); if( pWVT->bResizable ) style = style | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_THICKFRAME; else diff --git a/harbour/src/rtl/gtwvt/gtwvt.c b/harbour/src/rtl/gtwvt/gtwvt.c index 7e0b90ff2c..fcce04c98c 100644 --- a/harbour/src/rtl/gtwvt/gtwvt.c +++ b/harbour/src/rtl/gtwvt/gtwvt.c @@ -116,6 +116,9 @@ static HB_CRITICAL_NEW( s_wvtMtx ); # ifndef SetWindowLongPtr # define SetWindowLongPtr SetWindowLong # endif +# define HB_GTWVT_LONG_PTR LONG +#else +# define HB_GTWVT_LONG_PTR LONG_PTR #endif #ifndef WS_OVERLAPPEDWINDOW @@ -1972,8 +1975,9 @@ static HB_BOOL hb_gt_wvt_FullScreen( PHB_GT pGT ) { PHB_GTWVT pWVT; RECT rt; - DWORD dwStyle; - DWORD dwExtendedStyle; + + HB_GTWVT_LONG_PTR nStyle; + HB_GTWVT_LONG_PTR nExtendedStyle; /*Don't need this as Windows automatically maximizes to nearest [HVB] #ifdef MONITOR_DEFAULTTONEAREST @@ -1987,16 +1991,16 @@ static HB_BOOL hb_gt_wvt_FullScreen( PHB_GT pGT ) */ pWVT = HB_GTWVT_GET( pGT ); - dwStyle = GetWindowLongPtr( pWVT->hWnd, GWL_STYLE ); - dwExtendedStyle = GetWindowLongPtr( pWVT->hWnd, GWL_EXSTYLE ); + nStyle = GetWindowLongPtr( pWVT->hWnd, GWL_STYLE ); + nExtendedStyle = GetWindowLongPtr( pWVT->hWnd, GWL_EXSTYLE ); if( pWVT->bFullScreen ) { - dwStyle |= WS_CAPTION | WS_BORDER; - dwExtendedStyle |= WS_EX_TOPMOST; + nStyle |= WS_CAPTION | WS_BORDER; + nExtendedStyle |= WS_EX_TOPMOST; if( pWVT->bResizable ) - dwStyle |= WS_THICKFRAME; + nStyle |= WS_THICKFRAME; pWVT->MarginLeft = 0; pWVT->MarginTop = 0; @@ -2004,13 +2008,13 @@ static HB_BOOL hb_gt_wvt_FullScreen( PHB_GT pGT ) } else { - dwStyle &= ~( WS_CAPTION | WS_BORDER | WS_THICKFRAME ); - dwExtendedStyle &= ~WS_EX_TOPMOST; + nStyle &= ~( WS_CAPTION | WS_BORDER | WS_THICKFRAME ); + nExtendedStyle &= ~WS_EX_TOPMOST; pWVT->bFullScreen = HB_TRUE; } - SetWindowLongPtr( pWVT->hWnd, GWL_STYLE, dwStyle ); - SetWindowLongPtr( pWVT->hWnd, GWL_EXSTYLE, dwExtendedStyle ); + SetWindowLongPtr( pWVT->hWnd, GWL_STYLE, nStyle ); + SetWindowLongPtr( pWVT->hWnd, GWL_EXSTYLE, nExtendedStyle ); if( !pWVT->bFullScreen ) {