2011-05-09 12:24 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)

* contrib/gtwvg/gtwvg.c
  * contrib/gtwvg/wvgwin.c
    ! fixed to use GetModuleHandle() instead of LoadModule() on
      user32.dll and kernel32.dll. safer and faster.
This commit is contained in:
Viktor Szakats
2011-05-09 10:27:07 +00:00
parent ee193bd4a1
commit 9302977cad
3 changed files with 8 additions and 27 deletions

View File

@@ -16,6 +16,12 @@
The license applies to all entries newer than 2009-04-28.
*/
2011-05-09 12:24 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* contrib/gtwvg/gtwvg.c
* contrib/gtwvg/wvgwin.c
! fixed to use GetModuleHandle() instead of LoadModule() on
user32.dll and kernel32.dll. safer and faster.
2011-05-09 12:06 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* contrib/hbwin/wapi_winbase.c
* contrib/hbwin/hbwin.hbx

View File

@@ -2624,31 +2624,6 @@ static HB_BOOL hb_gt_wvt_CreateConsoleWindow( PHB_GTWVT pWVT )
if( !pWVT->hWnd )
hb_errInternal( 10001, "Failed to create WVT window", NULL, NULL );
/* An experimental call - processed at WndProc to recognize pWVT off hWnd */
#if 0
SetWindowLongPtr( pWVT->hWnd, GWL_USERDATA, ( LONG_PTR ) pWVT );
#endif
#if 0
if( ! GetSystemMetrics( SM_REMOTESESSION ) )
{
typedef BOOL ( WINAPI * P_SLWA )( HWND, COLORREF, BYTE, DWORD );
P_SLWA pSetLayeredWindowAttributes = ( P_SLWA )
GetProcAddress( GetModuleHandle( TEXT( "user32.dll" ) ),
"SetLayeredWindowAttributes" );
if( pSetLayeredWindowAttributes )
{
SetWindowLongPtr( pWVT->hWnd, GWL_EXSTYLE, GetWindowLongPtr( pWVT->hWnd, GWL_EXSTYLE ) | WS_EX_LAYERED );
pSetLayeredWindowAttributes( pWVT->hWnd,
( COLORREF ) 0 /* COLORREF crKey */,
255 /* BYTE bAlpha */,
LWA_ALPHA /* DWORD dwFlags */ );
}
}
#endif
hb_gt_wvt_InitWindow( pWVT, pWVT->ROWS, pWVT->COLS );
/* Set icon */
@@ -4365,7 +4340,7 @@ static void hb_wvt_gtLoadGuiData( void )
}
}
h = LoadLibraryEx( TEXT( "user32.dll" ), NULL, 0 );
h = GetModuleHandle( TEXT( "user32.dll" ) );
if( h )
{
s_guiData->pfnLayered = ( wvtSetLayeredWindowAttributes ) GetProcAddress( h, "SetLayeredWindowAttributes" );

View File

@@ -1148,7 +1148,7 @@ HB_FUNC( WVG_SETLAYEREDWINDOWATTRIBUTES )
HINSTANCE h;
wvtSetLayeredWindowAttributes pfnLayered;
h = LoadLibraryEx( TEXT( "user32.dll" ), NULL, 0 );
h = GetModuleHandle( TEXT( "user32.dll" ) );
if( h )
{
pfnLayered = ( wvtSetLayeredWindowAttributes ) GetProcAddress( h, "SetLayeredWindowAttributes" );