当前位置: 首页>>代码示例>>C++>>正文


C++ IVideoWindow::put_WindowState方法代码示例

本文整理汇总了C++中IVideoWindow::put_WindowState方法的典型用法代码示例。如果您正苦于以下问题:C++ IVideoWindow::put_WindowState方法的具体用法?C++ IVideoWindow::put_WindowState怎么用?C++ IVideoWindow::put_WindowState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IVideoWindow的用法示例。


在下文中一共展示了IVideoWindow::put_WindowState方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Hog

bool CHogVideo::Hog()
{
    if (!m_pGraph && !m_pMediaControl && !m_pVideoWindow)
        return false;

    this->UnHog();

    HRESULT hr = NULL;
    IGraphBuilder *pGraph           = (IGraphBuilder*)  m_pGraph;
    IMediaControl *pMediaControl    = (IMediaControl*)  m_pMediaControl;
    IVideoWindow  *pVideoWindow     = (IVideoWindow*)   m_pVideoWindow;

    // Build the graph. IMPORTANT: Change string to a file on your system.
    hr = pGraph->RenderFile(m_wszFilename, NULL);
    if (SUCCEEDED(hr))
    {
        // Run the graph.
        hr = pMediaControl->Run();
        // Hide the window
        pVideoWindow->put_WindowState(SW_HIDE);
        pVideoWindow->put_AutoShow(OAFALSE);
        pVideoWindow->put_Visible(OAFALSE);
        pVideoWindow->put_Top(-100);
        pVideoWindow->put_Left(-100);
        pVideoWindow->put_Width(0);
        pVideoWindow->put_Height(0);

        if (SUCCEEDED(hr))
        {
            // Hog the resource.
            pMediaControl->Pause();
            return true;
        }
        else
            return false;
    }
    else
        return false;
}
开发者ID:calupator,项目名称:wiredplane-wintools,代码行数:39,代码来源:HogVideo.cpp

示例2: play


//.........这里部分代码省略.........
				pGraph->EnumFilters(&iEnumFilters);

				ULONG filterCount = 16;
				IFilter *iFilters[16];
				iEnumFilters->Next(filterCount, iFilters, &filterCount);

				for( ULONG j = 0; j < filterCount; ++j )
				{
					FILTER_INFO filterInfo;
					iFilters[j]->QueryFilterInfo(&filterInfo);
					filterInfo.pGraph->Release();
					iFilters[j]->Release();
				}

				iEnumFilters->Release();
			}*/

			iVideoWindow->HideCursor(OATRUE);
			iVideoWindow->put_Visible( OAFALSE );
			iVideoWindow->put_AutoShow( OAFALSE );
			LONG windowStyle;
			iVideoWindow->get_WindowStyle( &windowStyle);
			windowStyle &= ~WS_BORDER & ~WS_CAPTION & ~WS_SIZEBOX & ~WS_THICKFRAME &
				~WS_HSCROLL & ~WS_VSCROLL & ~WS_VISIBLE;
			iVideoWindow->put_WindowStyle( windowStyle);
		}
		else
			iVideoWindow = NULL;
		
		if( (hr = pGraph->QueryInterface(IID_IMediaControl, (void **) &pMC)) == 0)
		{
			pMC->Run();					// sometimes it returns 1, but still ok
			state = PLAYING;
			pMC->Release();
		}

		if( iVideoWindow )
		{
			iVideoWindow->put_Visible( OAFALSE );
			LONG windowStyle;
			iVideoWindow->get_WindowStyle( &windowStyle);
			windowStyle &= ~WS_BORDER & ~WS_CAPTION & ~WS_SIZEBOX & ~WS_THICKFRAME &
				~WS_HSCROLL & ~WS_VSCROLL & ~WS_VISIBLE;
			iVideoWindow->put_WindowStyle( windowStyle);

			LONG maxWidth;
			LONG maxHeight;
			hr=iVideoWindow->GetMaxIdealImageSize( &maxWidth, &maxHeight);
#ifdef FULL_SCREEN_VIDEO
#else
			iVideoWindow->put_BorderColor( RGB(0,0,0) );
			iVideoWindow->put_WindowState(SW_MAXIMIZE);

			IBaseFilter *iFilter;
			if( pGraph->FindFilterByName((const WCHAR *)L"Video Renderer", &iFilter) == 0)
			{
				IBasicVideo *iBasicVideo;
				if( iFilter->QueryInterface(IID_IBasicVideo, (void **)&iBasicVideo) == 0)
				{
					LONG screenWidth;
					LONG screenHeight;
					LONG videoWidth;
					LONG videoHeight;
					if( iVideoWindow->get_Width(&screenWidth) == 0 &&
						iVideoWindow->get_Height(&screenHeight) == 0 &&
						iBasicVideo->GetVideoSize(&videoWidth, &videoHeight) == 0)
					{
						// zoom in by 2 if possible
						if( screenWidth >= videoWidth * 2 &&
							screenHeight >= videoHeight * 2)
						{
							videoWidth *= 2;
							videoHeight *= 2;
						}

						// center the video client area
						iBasicVideo->SetDestinationPosition(
							(screenWidth-videoWidth)/2, (screenHeight-videoHeight)/2,
							videoWidth, videoHeight);
					}

					iBasicVideo->Release();
				}
				iFilter->Release();
			}
#endif
			iVideoWindow->HideCursor(OATRUE);
			iVideoWindow->SetWindowForeground(OATRUE);
		}

		if(iVideoWindow)
		{
			iVideoWindow->Release();
			iVideoWindow = NULL;
		}
	}

	if( hr && !skip_on_fail_flag)
		err.run("video.play error %d", hr );
}
开发者ID:the3dfxdude,项目名称:7kaa,代码行数:101,代码来源:OVIDEO.cpp


注:本文中的IVideoWindow::put_WindowState方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。