summaryrefslogtreecommitdiff
path: root/vcl/win
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2005-01-31 08:23:50 +0000
committerRüdiger Timm <rt@openoffice.org>2005-01-31 08:23:50 +0000
commite234523e1188a54013cd99c331840dbc2d670fa0 (patch)
tree29533d95a689a18676af7ea9dbb8b2e42b7d829c /vcl/win
parentf91c2e52b9708d2006812102dd471bb4f81502d1 (diff)
INTEGRATION: CWS vcl34 (1.111.26); FILE MERGED
2005/01/12 15:30:00 dv 1.111.26.2: #107733# Use osl_loadModule instead of LoadLibrary 2005/01/07 14:32:25 ssa 1.111.26.1: #i40008# keep ownerdraw windows on screen when positioned by API
Diffstat (limited to 'vcl/win')
-rw-r--r--vcl/win/source/window/salframe.cxx48
1 files changed, 38 insertions, 10 deletions
diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx
index 9b3607606b1a..8d0163293df2 100644
--- a/vcl/win/source/window/salframe.cxx
+++ b/vcl/win/source/window/salframe.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: salframe.cxx,v $
*
- * $Revision: 1.113 $
+ * $Revision: 1.114 $
*
- * last change: $Author: kz $ $Date: 2005-01-21 13:40:21 $
+ * last change: $Author: rt $ $Date: 2005-01-31 09:23:50 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -77,6 +77,8 @@
#include <rtl/ustring.h>
#endif
+#include <osl/module.h>
+
#ifndef _DEBUG_HXX
#include <tools/debug.hxx>
#endif
@@ -381,9 +383,20 @@ SalFrame* ImplSalCreateFrame( WinSalInstance* pInst,
// check for W2k and XP
if ( aVerInfo.dwPlatformId == VER_PLATFORM_WIN32_NT && aVerInfo.dwMajorVersion >= 5 )
{
- bLayeredAPI = 1;
- HMODULE hModule = LoadLibrary("user32");
- if( !(lpfnSetLayeredWindowAttributes = ( SetLayeredWindowAttributes_Proc_T )GetProcAddress( hModule, "SetLayeredWindowAttributes" ) ) )
+ OUString aLibraryName( RTL_CONSTASCII_USTRINGPARAM( "user32" ) );
+ oslModule pLib = osl_loadModule( aLibraryName.pData, SAL_LOADMODULE_DEFAULT );
+ void *pFunc = NULL;
+ if( pLib )
+ {
+ OUString queryFuncName( RTL_CONSTASCII_USTRINGPARAM( "SetLayeredWindowAttributes" ) );
+ pFunc = osl_getSymbol( pLib, queryFuncName.pData );
+ }
+
+ lpfnSetLayeredWindowAttributes = ( SetLayeredWindowAttributes_Proc_T ) pFunc;
+
+ if ( pFunc )
+ bLayeredAPI = 1;
+ else
bLayeredAPI = 0;
}
}
@@ -1521,9 +1534,22 @@ void WinSalFrame::SetPosSize( long nX, long nY, long nWidth, long nHeight,
// Adjust Window in the screen
- // but don't do this for floaters or ownerdraw windows
- // TODO: move this into independent layer
- if( !(mnStyle & (SAL_FRAME_STYLE_FLOAT|SAL_FRAME_STYLE_OWNERDRAWDECORATION) ) )
+ BOOL bCheckOffScreen = TRUE;
+
+ // but don't do this for floaters or ownerdraw windows that are currently moved interactively
+ if( (mnStyle & SAL_FRAME_STYLE_FLOAT) && !(mnStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION) )
+ bCheckOffScreen = FALSE;
+
+ if( mnStyle & SAL_FRAME_STYLE_OWNERDRAWDECORATION )
+ {
+ // may be the window is currently being moved (mouse is captured), then no check is required
+ if( mhWnd == ::GetCapture() )
+ bCheckOffScreen = FALSE;
+ else
+ bCheckOffScreen = TRUE;
+ }
+
+ if( bCheckOffScreen )
{
if ( nX+nWidth > nScreenX+nScreenWidth )
nX = (nScreenX+nScreenWidth) - nWidth;
@@ -1959,8 +1985,10 @@ void WinSalFrame::StartPresentation( BOOL bStart )
if ( !aOS.nErrCode )
{
- pSalData->mhSageInst = LoadLibrary( aOS.szPathName );
- pSalData->mpSageEnableProc = (SysAgt_Enable_PROC)GetProcAddress( pSalData->mhSageInst, "System_Agent_Enable" );
+ OUString aLibraryName( OUString::createFromAscii( aOS.szPathName ) );
+ oslModule mhSageInst = osl_loadModule( aLibraryName.pData, SAL_LOADMODULE_DEFAULT );
+ OUString queryFuncName( RTL_CONSTASCII_USTRINGPARAM( "System_Agent_Enable" ) );
+ pSalData->mpSageEnableProc = (SysAgt_Enable_PROC) osl_getSymbol( mhSageInst, queryFuncName.pData );
}
else
pSalData->mnSageStatus = DISABLE_AGENT;