summaryrefslogtreecommitdiff
path: root/vcl/win/source/window/salobj.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/win/source/window/salobj.cxx')
-rw-r--r--vcl/win/source/window/salobj.cxx50
1 files changed, 50 insertions, 0 deletions
diff --git a/vcl/win/source/window/salobj.cxx b/vcl/win/source/window/salobj.cxx
index 2f657968284f..6d00242ef313 100644
--- a/vcl/win/source/window/salobj.cxx
+++ b/vcl/win/source/window/salobj.cxx
@@ -39,6 +39,7 @@
#include <salframe.h>
#include <salobj.h>
#include <tools/debug.hxx>
+#include <vcl/svapp.hxx>
// =======================================================================
@@ -103,6 +104,46 @@ WinSalFrame* ImplFindSalObjectFrame( HWND hWnd )
// -----------------------------------------------------------------------
+sal_Bool ImplInterceptChildWindowKeyDown( MSG& rMsg )
+{
+ sal_Bool bResult = sal_False;
+ if ( rMsg.message == WM_KEYDOWN )
+ {
+ wchar_t pClassName[10];
+ sal_Int32 nLen = GetClassNameW( rMsg.hwnd, pClassName, 10 );
+ if ( !( nLen == 9 && wcsncmp( pClassName, SAL_OBJECT_CLASSNAMEW, nLen ) == 0 ) )
+ {
+ // look for the first SalObject in the parent hierarchy
+ HWND hWin = rMsg.hwnd;
+ HWND hLastOLEWindow = hWin;
+ WinSalObject* pSalObj = NULL;
+ do
+ {
+ hLastOLEWindow = hWin;
+ hWin = ::GetParent( hWin );
+ if ( hWin )
+ {
+ nLen = GetClassNameW( hWin, pClassName, 10 );
+ if ( nLen == 9 && wcsncmp( pClassName, SAL_OBJECT_CLASSNAMEW, nLen ) == 0 )
+ pSalObj = GetSalObjWindowPtr( hWin );
+ }
+ } while( hWin && !pSalObj );
+
+ if ( pSalObj && pSalObj->mbInterceptChildWindowKeyDown && pSalObj->maSysData.hWnd )
+ {
+ bResult = ( 1 == ImplSendMessage( pSalObj->maSysData.hWnd, rMsg.message, rMsg.wParam, rMsg.lParam ) );
+ }
+ }
+ }
+
+ return bResult;
+}
+
+// -----------------------------------------------------------------------
+
+
+// -----------------------------------------------------------------------
+
LRESULT CALLBACK SalSysMsgProc( int nCode, WPARAM wParam, LPARAM lParam )
{
// Used for Unicode and none Unicode
@@ -623,6 +664,7 @@ WinSalObject::WinSalObject()
mhLastFocusWnd = 0;
maSysData.nSize = sizeof( SystemEnvData );
mpStdClipRgnData = NULL;
+ mbInterceptChildWindowKeyDown = sal_False;
// Insert object in objectlist
mpNextObject = pSalData->mpFirstObject;
@@ -836,3 +878,11 @@ const SystemEnvData* WinSalObject::GetSystemData() const
{
return &maSysData;
}
+
+// -----------------------------------------------------------------------
+
+void WinSalObject::InterceptChildWindowKeyDown( sal_Bool bIntercept )
+{
+ mbInterceptChildWindowKeyDown = bIntercept;
+}
+