Microsoft DirectX 9.0

IAMDirectSound::SetWindowFocus

The SetWindowFocus method specifies a window to handle sound playback.

Syntax

HRESULT SetWindowFocus(
  HWND hWnd,
  BOOL bMixingOnOrOff
);

Parameters

hWnd

[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.

bMixingOnOrOff

[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