IDirectInputJoyConfig8::SetCooperativeLevel method (dinputd.h)

The IDirectInputJoyConfig8::SetCooperativeLevel method establishes the cooperation level for the instance of the device. The only cooperative levels supported for the IDirectInputJoyConfig8 interface are DISCL_EXCLUSIVE and DISCL_BACKGROUND.


HRESULT SetCooperativeLevel(
  HWND  unnamedParam1,
  DWORD unnamedParam2



Handle to the window associated with the interface. This parameter must be non-NULL and must be a top-level window. It is an error to destroy the window while it is still associated with an IDirectInputJoyConfig8 interface.


Specifies one of a set of flags that describe the level of cooperation associated with the device. The value must be DISCL_EXCLUSIVE | DISCL_BACKGROUND.

Return value

Returns DI_OK if successful; otherwise, returns the following COM error value (this value is intended to be illustrative and is not necessarily comprehensive):

Return code Description
One or more parameters was invalid.


Target Platform Desktop
Header dinputd.h (include Dinputd.h)