diff options
Diffstat (limited to 'avmedia')
-rw-r--r-- | avmedia/source/win/window.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
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<int>(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<int>(::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 ); |