> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XInputSetState

> XInputSetState

# XInputSetState

Envoie des données de vibration à la manette à deux moteurs spécifiée.

<a id="syntaxSection" />

## Syntaxe

```cpp theme={null}
DWORD XInputSetState(  
         DWORD dwUserIndex,  
         const XINPUT_VIBRATION * pVibration  
)  
```

<a id="parametersSection" />

### Paramètres

*dwUserIndex*   \_In\_\
Type : DWORD

Index du joueur associé à l'appareil; valeur comprise entre 0 et `XUSER_MAX_COUNT - 1`.

*pVibration*   \_In\_\
Type : [XINPUT\_VIBRATION](/fr-CA/reference/input/xinputongameinput/structs/xinput_vibration)\*

Pointeur vers un objet [XINPUT\_VIBRATION](/fr-CA/reference/input/xinputongameinput/structs/xinput_vibration) qui contient les informations de vibration à envoyer à la manette.

<a id="retvalSection" />

### Valeur de retour

Type : DWORD

Si la fonction réussit, elle retourne `ERROR_SUCCESS`.

Si la manette n'est pas connectée, la fonction retourne `ERROR_DEVICE_NOT_CONNECTED`.

Si la fonction échoue, elle retourne un code d'erreur défini dans WinError.h.

<a id="remarksSection" />

## Remarques

Cette fonction prend en charge les anciennes manettes qui ne possèdent que deux moteurs de retour haptique. Pour prendre en charge les moteurs de retour supplémentaires des manettes plus récentes, appelez [XInputSetStateEx](/fr-CA/reference/input/xinputongameinput/functions/xinputsetstateex).

Pour plus d'informations, consultez [Le wrapper XInputOnGameInput](/fr-CA/build/core-features/common/input/porting/input-porting-xinput#xinputWrapperSection).

<a id="requirementsSection" />

## Configuration requise

**En-tête :** XInputOnGameInput.h

**Bibliothèque :** xgameruntime.lib

**Plateformes prises en charge :** consoles de la famille XBOX One et consoles XBOX Series

<a id="seealsoSection" />

## Voir aussi

[Portage d'XInput vers GameInput](/fr-CA/build/core-features/common/input/porting/input-porting-xinput)\
[XInputOnGameInput](/fr-CA/reference/input/xinputongameinput/xinputongameinput_members)


## Related topics

- [XInputSetState](/reference/input/xinputongameinput/functions/xinputsetstate.md)
- [XInputSetStateEx](/reference/input/xinputongameinput/functions/xinputsetstateex.md)
