Compartilhar via


IMFVideoDisplayControl::SetFullscreen method (evr.h)

[The component described on this page, Enhanced Video Renderer, is a legacy feature. It has been superseded by the Simple Video Renderer (SVR) exposed through the MediaPlayer and IMFMediaEngine components. To play video content you should send data into one of these components and allow them to instantiate the new video renderer. These components have been optimized for Windows 10 and Windows 11. Microsoft strongly recommends that new code use MediaPlayer or the lower level IMFMediaEngine APIs to play video media in Windows instead of the EVR, when possible. Microsoft suggests that existing code that uses the legacy APIs be rewritten to use the new APIs if possible.]

[This API is not supported and may be altered or unavailable in the future. ]

Sets or unsets full-screen rendering mode.

To implement full-screen playback, an application should simply resize the video window to cover the entire area of the monitor. Also set the window to be a topmost window, so that the application receives all mouse-click messages. For more information about topmost windows, see the documentation for the SetWindowPos function.

Syntax

HRESULT SetFullscreen(
  [in] BOOL fFullscreen
);

Parameters

[in] fFullscreen

If TRUE, the enhanced video renderer (EVR) uses full-screen mode. If FALSE, the EVR draws the video in the application-provided clipping window.

Return value

The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.

Return code Description
S_OK
The method succeeded.
MF_E_SHUTDOWN
The video renderer has been shut down.

Remarks

The default EVR presenter implements full-screen mode using Direct3D exclusive mode.

If you use this method to switch to full-screen mode, set the application window to be a topmost window and resize the window to cover the entire monitor. This ensures that the application window receives all mouse-click messages. Also set the keyboard focus to the application window. When you switch out of full-screen mode, restore the window's original size and position.

By default, the cursor is still visible in full-screen mode. To hide the cursor, call ShowCursor.

The transition to and from full-screen mode occurs asynchronously. To get the current mode, call IMFVideoDisplayControl::GetFullscreen.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header evr.h
Library Strmiids.lib

See also

Enhanced Video Renderer

IMFVideoDisplayControl

Using the Video Display Controls