From 7ca026a4f444b4ecfc2e07a645899b0bceeb5aa3 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 16 Feb 2010 18:51:23 +0000 Subject: [PATCH] 2010-02-16 19:50 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * src/rtl/gtwvt/gtwvt.c * contrib/gtwvg/gtwvg.c * Replaced _WIN32_WINNT redefinition with #definition of WS_EX_LAYERED constant, in case it's not defined by Windows headers. * contrib/hbwin/wapi_wingdi_font.c + Accessing the W2K specific functions dynamically. + Defining the high-level functions also in WinCE, returning permanent error. ! Deleted _WIN32_WINNT redefinition. ; Someone pls test these using older compiler/SDK version. --- harbour/ChangeLog | 17 ++++++++- harbour/contrib/gtwvg/gtwvg.c | 11 +++--- harbour/contrib/hbwin/wapi_wingdi_font.c | 48 ++++++++++++++++++------ harbour/src/rtl/gtwvt/gtwvt.c | 11 +++--- 4 files changed, 65 insertions(+), 22 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index edad5a327b..317288eec2 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,21 @@ past entries belonging to author(s): Viktor Szakats. */ +2010-02-16 19:50 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * src/rtl/gtwvt/gtwvt.c + * contrib/gtwvg/gtwvg.c + * Replaced _WIN32_WINNT redefinition with + #definition of WS_EX_LAYERED constant, in case it's not defined + by Windows headers. + + * contrib/hbwin/wapi_wingdi_font.c + + Accessing the W2K specific functions dynamically. + + Defining the high-level functions also in WinCE, returning + permanent error. + ! Deleted _WIN32_WINNT redefinition. + + ; Someone pls test these using older compiler/SDK version. + 2010-02-16 09:21 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com) * contrib/hbide/hbide.prg * contrib/hbide/ideactions.prg @@ -25,7 +40,7 @@ * contrib/hbide/ideobject.prg * contrib/hbide/ideprojmanager.prg * contrib/hbide/idestylesheets.prg - + Started left-hand toolbar(s) to present visual interactions for + + Started left-hand toolbar(s) to present visual interactions for a number of hidden actions. A work-in-progress. * contrib/hbqt/THbQtUI.prg diff --git a/harbour/contrib/gtwvg/gtwvg.c b/harbour/contrib/gtwvg/gtwvg.c index fc6ac78e0e..daec9840e5 100644 --- a/harbour/contrib/gtwvg/gtwvg.c +++ b/harbour/contrib/gtwvg/gtwvg.c @@ -82,13 +82,14 @@ * */ -#undef _WIN32_WINNT -#define _WIN32_WINNT 0x0500 /* Set to Windows 2000 for WS_EX_LAYERED */ - #include "gtwvg.h" -#if !defined( SM_REMOTESESSION ) - #define SM_REMOTESESSION 0x1000 +#ifndef WS_EX_LAYERED +#define WS_EX_LAYERED 0x00080000 +#endif + +#ifndef SM_REMOTESESSION +#define SM_REMOTESESSION 0x1000 #endif static int s_GtId; diff --git a/harbour/contrib/hbwin/wapi_wingdi_font.c b/harbour/contrib/hbwin/wapi_wingdi_font.c index d8e83c7c13..53c6abb536 100644 --- a/harbour/contrib/hbwin/wapi_wingdi_font.c +++ b/harbour/contrib/hbwin/wapi_wingdi_font.c @@ -50,28 +50,54 @@ * */ -#define _WIN32_WINNT 0x0500 - #include "hbwapi.h" -#if ! defined( HB_OS_WIN_CE ) - HB_FUNC( WAPI_ADDFONTRESOURCEEX ) { - void * hFileName; + int iResult = 0; - hb_retni( AddFontResourceEx( HB_PARSTRDEF( 1, &hFileName, NULL ), ( DWORD ) hb_parnl( 2 ), NULL ) ); +#if ! defined( HB_OS_WIN_CE ) + { + typedef int ( WINAPI * _HB_ADDFONTRESOURCEEX )( LPCTSTR, DWORD, PVOID ); - hb_strfree( hFileName ); + static _HB_ADDFONTRESOURCEEX s_pAddFontResourceEx = NULL; + + if( ! s_pAddFontResourceEx ) + s_pAddFontResourceEx = ( _HB_ADDFONTRESOURCEEX ) GetProcAddress( GetModuleHandle( TEXT( "gdi32.dll" ) ), "AddFontResourceEx" ); + + if( s_pAddFontResourceEx ) + { + void * hFileName; + iResult = s_pAddFontResourceEx( HB_PARSTRDEF( 1, &hFileName, NULL ), ( DWORD ) hb_parnl( 2 ), NULL ); + hb_strfree( hFileName ); + } + } +#endif + + hb_retni( iResult ); } HB_FUNC( WAPI_REMOVEFONTRESOURCEEX ) { - void * hFileName; + int iResult = 0; - hb_retni( RemoveFontResourceEx( HB_PARSTRDEF( 1, &hFileName, NULL ), ( DWORD ) hb_parnl( 2 ), NULL ) ); +#if ! defined( HB_OS_WIN_CE ) + { + typedef int ( WINAPI * _HB_REMOVEFONTRESOURCEEX )( LPCTSTR, DWORD, PVOID ); - hb_strfree( hFileName ); -} + static _HB_REMOVEFONTRESOURCEEX s_pRemoveFontResourceEx = NULL; + if( ! s_pRemoveFontResourceEx ) + s_pRemoveFontResourceEx = ( _HB_REMOVEFONTRESOURCEEX ) GetProcAddress( GetModuleHandle( TEXT( "gdi32.dll" ) ), "RemoveFontResourceEx" ); + + if( s_pRemoveFontResourceEx ) + { + void * hFileName; + iResult = s_pRemoveFontResourceEx( HB_PARSTRDEF( 1, &hFileName, NULL ), ( DWORD ) hb_parnl( 2 ), NULL ); + hb_strfree( hFileName ); + } + } #endif + + hb_retni( iResult ); +} diff --git a/harbour/src/rtl/gtwvt/gtwvt.c b/harbour/src/rtl/gtwvt/gtwvt.c index f8426bac65..8f3c7124c1 100644 --- a/harbour/src/rtl/gtwvt/gtwvt.c +++ b/harbour/src/rtl/gtwvt/gtwvt.c @@ -82,13 +82,14 @@ * */ -#undef _WIN32_WINNT -#define _WIN32_WINNT 0x0500 /* Set to Windows 2000 for WS_EX_LAYERED */ - #include "gtwvt.h" -#if !defined( SM_REMOTESESSION ) - #define SM_REMOTESESSION 0x1000 +#ifndef WS_EX_LAYERED +#define WS_EX_LAYERED 0x00080000 +#endif + +#ifndef SM_REMOTESESSION +#define SM_REMOTESESSION 0x1000 #endif static int s_GtId;