Microsoft DirectX 8.1 (Visual Basic)

DirectSound8.SetCooperativeLevel

The SetCooperativeLevel method sets the cooperative level of the application for this sound device.

Syntax

object.SetCooperativeLevel( _
  hwnd As Long, _
  level As CONST_DSSCLFLAGS)

Parts

object

Resolves to a DirectSound8 object.

hwnd

Window handle to the application. See Remarks.

level

Requested priority level. Must be a constant of the CONST_DSSCLFLAGS enumeration.

Error Codes

If the method fails, an error is raised and Err.Number may be one of the following error values.

DSERR_ALLOCATED
DSERR_INVALIDPARAM
DSERR_UNINITIALIZED
DSERR_UNSUPPORTED

Remarks

The application must set the cooperative level by calling this method before its buffers can be played. The recommended cooperative level is DSSCL_PRIORITY.

The hwnd parameter should be the top-level application window handle.

See Also