IResourceManager::SetFocus method (strmif.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.]
SetFocus method notifies the resource manager that a specified object has been given the focus of the user.
HRESULT SetFocus( [in] IUnknown *pFocusObject );
Pointer to the object that has been given the user's focus.
Returns an HRESULT value that depends on the implementation. HRESULT can be one of the following standard constants, or other values not listed.
||NULL pointer argument.|
||Method isn't supported.|
In DirectShow, the object given the user's focus is typically a video renderer whose window has received the focus. The resource manager gives priority to requests for resources in the following order:
- Requests made with the focus object specified in the pFocusObject parameter.
- Requests whose focus object shares a common source filter.
- Requests whose focus object shares a common filter graph.
- Requests in the same process as the focus.
SetFocusis called by a different object in the meantime. No reference count is held on the focus object.
The resource manager will hold this pointer until replaced or canceled, and will use it to resolve resource contention. It will use QueryInterface for the IBaseFilter interface at least and, if found, will use methods on that interface. It calls methods on IBaseFilter to decide which audio renderer to use if there are two (it will choose the one with a source filter common to the focus object), and also to determine if the two objects are within the same filter graph.
|Minimum supported client||Windows 2000 Professional [desktop apps only]|
|Minimum supported server||Windows 2000 Server [desktop apps only]|
|Header||strmif.h (include Dshow.h)|