XInputSetState function

Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
This topic has not yet been rated - Rate this topic

Sends data to a connected controller. This function is used to activate the vibration function of a controller.

Syntax


DWORD XInputSetState(
  _In_     DWORD dwUserIndex,
  _Inout_  INPUT_VIBRATION *pVibration
);

Parameters

dwUserIndex [in]

Index of the user's controller. Can be a value from 0 to 3. For information about how this value is determined and how the value maps to indicators on the controller, see Multiple Controllers.

pVibration [in, out]

Pointer to an XINPUT_VIBRATION structure containing the vibration information to send to the controller.

Return value

If the function succeeds, the return value is ERROR_SUCCESS.

If the controller is not connected, the return value is ERROR_DEVICE_NOT_CONNECTED.

If the function fails, the return value is an error code defined in Winerror.h. The function does not use SetLastError to set the calling thread's last-error code.

Platform Requirements

Windows 8 (XInput 1.4), DirectX SDK (XInput 1.3), Windows Vista (XInput 9.1.0)

Requirements

Header

Declared in XInput.h.

Library

Use xinput.lib or xinput9_1_0.lib.

DLL

Xinput.dll

See also

XInput Functions
XInputGetState
XINPUT_VIBRATION

 

 

Send comments about this topic to Microsoft

Build date: 9/17/2012

Did you find this helpful?
(1500 characters remaining)

Community Additions

© 2013 Microsoft. All rights reserved.