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

# XInputGetBatteryInformation

> XInputGetBatteryInformation

# XInputGetBatteryInformation

Récupère le type de batterie et l'état de charge d'une manette sans fil.

<a id="syntaxSection" />

## Syntaxe

```cpp theme={null}
DWORD XInputGetBatteryInformation(  
         DWORD dwUserIndex,  
         BYTE devType,  
         XINPUT_BATTERY_INFORMATION* pBatteryInformation  
)  
```

<a id="parametersSection" />

### Paramètres

*dwUserIndex*   \_In\_\
Type : DWORD

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

*devType*   \_In\_\
Type : BYTE

Type d'appareil associé à *dwUserIndex* à interroger. Doit être `BATTERY_DEVTYPE_GAMEPAD` ou `BATTERY_DEVTYPE_HEADSET`.

*pBatteryInformation*   \_Out\_\
Type : [XINPUT\_BATTERY\_INFORMATION](/fr/reference/input/xinputongameinput/structs/xinput_battery_information)\*

Pointeur vers un objet [XINPUT\_BATTERY\_INFORMATION](/fr/reference/input/xinputongameinput/structs/xinput_battery_information) qui reçoit les informations sur la batterie.

<a id="retvalSection" />

### Valeur renvoyée

Type : DWORD

Si la fonction réussit, la valeur renvoyée est `ERROR_SUCCESS`.

<a id="remarksSection" />

## Remarques

Les valeurs renvoyées dans *pBatteryInformation* indiquent le type de batterie et son état de charge. L'état de charge n'est valide que pour un appareil dont le type de batterie est connu.

Pour plus d'informations, consultez [Le wrapper XInputOnGameInput](/fr/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 de XInput vers GameInput](/fr/build/core-features/common/input/porting/input-porting-xinput)\
[XInputOnGameInput](/fr/reference/input/xinputongameinput/xinputongameinput_members)


## Related topics

- [XInputGetBatteryInformation](/reference/input/xinputongameinput/functions/xinputgetbatteryinformation.md)
- [XINPUT_BATTERY_INFORMATION](/reference/input/xinputongameinput/structs/xinput_battery_information.md)
