Microsoft DirectX 9.0


The SetWindowFocus method specifies a window to handle sound playback.


HRESULT SetWindowFocus(
  HWND hWnd,
  BOOL bMixingOnOrOff



[in]  Specifies a handle to the window. If this value is NULL, the sound will not be associated with any window.

Note   Windows NT 4.0 does not support windowless sound playback.


[in]  Specifies whether to mix the sound when the window loses focus.

Value Description
TRUE The sound is audible when the window loses focus.
FALSE The sound is not audible when the windows loses focus.

Return Values

Returns an HRESULT value. Possible values include the following.

Return code Description
E_FAIL Failure.
S_OK Success.

See Also