mciqtz32: Handle mciOpen better.

This commit is contained in:
Maarten Lankhorst 2010-05-18 20:14:07 +02:00 committed by Alexandre Julliard
parent 4ddfba41af
commit 4eddb852b1
1 changed files with 27 additions and 0 deletions

View File

@ -145,6 +145,8 @@ static DWORD MCIQTZ_mciOpen(UINT wDevID, DWORD dwFlags,
{
WINE_MCIQTZ* wma;
HRESULT hr;
IBasicVideo *vidbasic;
IVideoWindow *vidwin;
TRACE("(%04x, %08X, %p)\n", wDevID, dwFlags, lpOpenParms);
@ -190,6 +192,31 @@ static DWORD MCIQTZ_mciOpen(UINT wDevID, DWORD dwFlags,
goto err;
}
hr = IFilterGraph2_QueryInterface(wma->pgraph, &IID_IVideoWindow, (void**)&vidwin);
if (SUCCEEDED(hr))
hr = IFilterGraph2_QueryInterface(wma->pgraph, &IID_IBasicVideo, (void**)&vidbasic);
if (SUCCEEDED(hr)) {
DWORD style;
RECT rc = { 0, 0, 0, 0 };
IVideoWindow_put_AutoShow(vidwin, OAFALSE);
style = 0;
if (dwFlags & MCI_DGV_OPEN_WS)
style |= lpOpenParms->dwStyle;
if (dwFlags & MCI_DGV_OPEN_PARENT) {
style |= WS_CHILD;
IVideoWindow_put_MessageDrain(vidwin, (OAHWND)lpOpenParms->hWndParent);
IVideoWindow_put_WindowState(vidwin, SW_HIDE);
IVideoWindow_put_Owner(vidwin, (OAHWND)lpOpenParms->hWndParent);
}
IVideoWindow_put_WindowStyle(vidwin, style);
IBasicVideo_GetVideoSize(vidbasic, &rc.right, &rc.bottom);
IVideoWindow_SetWindowPosition(vidwin, rc.left, rc.top, rc.right, rc.bottom);
IVideoWindow_put_Visible(vidwin, OATRUE);
IBasicVideo_Release(vidbasic);
}
if (vidwin)
IVideoWindow_Release(vidwin);
wma->opened = TRUE;
return 0;