共用方式為


IVMRMonitorConfig9::SetMonitor method (vmr9.h)

[The feature associated with this page, DirectShow, is a legacy feature. It has been superseded by MediaPlayer, IMFMediaEngine, and Audio/Video Capture in Media Foundation. Those features have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer, IMFMediaEngine and Audio/Video Capture in Media Foundation instead of DirectShow, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

On a multi-monitor system, the SetMonitor method specifies the monitor that the VMR should use when it creates the Direct3D device.

Syntax

HRESULT SetMonitor(
  [in] UINT uDev
);

Parameters

[in] uDev

Index that specifies the monitor.

Return value

The method returns an HRESULT. Possible values include the following.

Return code Description
E_INVALIDARG
Invalid argument; uDev does not correspond to a valid monitor.
S_OK
The method succeeded.
VFW_E_WRONG_STATE
Cannot set the monitor after the VMR's input pins have been connected.

Remarks

Use this method on a multi-monitor system to specify to the VMR which Direct3D device should be used when connecting to an upstream decoder filter.

Include DShow.h and D3d9.h before Vmr9.h.

Requirements

Requirement Value
Minimum supported client Windows XP with SP2 [desktop apps only]
Minimum supported server Windows Server 2003 R2 [desktop apps only]
Target Platform Windows
Header vmr9.h
Library Strmiids.lib

See also

IVMRMonitorConfig9 Interface

IVMRMonitorConfig9::GetMonitor

Using the Video Mixing Renderer