From 00b3aa66248169c36eb3a2bda588099497a07513 Mon Sep 17 00:00:00 2001 From: RĂ¼diger Timm Date: Mon, 29 Sep 2008 11:39:44 +0000 Subject: CWS-TOOLING: integrate CWS impress160_DEV300 --- avmedia/source/win/window.cxx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/avmedia/source/win/window.cxx b/avmedia/source/win/window.cxx index 2c315eae3947..a0c2b24ef899 100644 --- a/avmedia/source/win/window.cxx +++ b/avmedia/source/win/window.cxx @@ -323,11 +323,23 @@ bool Window::create( const uno::Sequence< uno::Any >& rArguments ) rArguments[ 1 ] >>= aRect; mnParentWnd = static_cast(nWnd); + mnFrameWnd = (int) ::CreateWindow( mpWndClass->lpszClassName, NULL, WS_VISIBLE | WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, aRect.X, aRect.Y, aRect.Width, aRect.Height, (HWND) mnParentWnd, NULL, mpWndClass->hInstance, 0 ); + // if the last CreateWindow failed... + if( mnFrameWnd == 0 ) + { + // try again and this time assume that mnParent is indeed a dc + mnParentWnd = reinterpret_cast(::WindowFromDC( (HDC)mnParentWnd )); + mnFrameWnd = (int) ::CreateWindow( mpWndClass->lpszClassName, NULL, + WS_VISIBLE | WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, + aRect.X, aRect.Y, aRect.Width, aRect.Height, + (HWND)mnParentWnd , NULL, mpWndClass->hInstance, 0 ); + } + if( mnFrameWnd ) { ::SetWindowLong( (HWND) mnFrameWnd, 0, (DWORD) this ); -- cgit