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

Recupera el tipo de batería y el estado de carga de un mando inalámbrico.

<a id="syntaxSection" />

## Sintaxis

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

<a id="parametersSection" />

### Parámetros

*dwUserIndex*   \_In\_\
Tipo: DWORD

Índice del jugador asociado al dispositivo; un valor en el intervalo de 0 a `XUSER_MAX_COUNT - 1`.

*devType*   \_In\_\
Tipo: BYTE

El tipo de dispositivo asociado a *dwUserIndex* que se va a consultar. Debe ser `BATTERY_DEVTYPE_GAMEPAD` o `BATTERY_DEVTYPE_HEADSET`.

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

Puntero a un objeto [XINPUT\_BATTERY\_INFORMATION](/reference/input/xinputongameinput/structs/xinput_battery_information) que recibe la información de la batería.

<a id="retvalSection" />

### Valor devuelto

Tipo: DWORD

Si la función se ejecuta correctamente, el valor devuelto es `ERROR_SUCCESS`.

<a id="remarksSection" />

## Comentarios

Los valores devueltos en *pBatteryInformation* especifican el tipo de batería y el estado de su carga. El estado de carga solo es válido para un dispositivo que tiene un tipo de batería conocido.

Para obtener más información, consulte [El contenedor XInputOnGameInput](/build/core-features/common/input/porting/input-porting-xinput#xinputWrapperSection).

<a id="requirementsSection" />

## Requisitos

**Encabezado:** XInputOnGameInput.h

**Biblioteca:** xgameruntime.lib

**Plataformas compatibles:** consolas de la familia XBOX One y consolas XBOX Series

<a id="seealsoSection" />

## Consulte también

[Portabilidad de XInput a GameInput](/build/core-features/common/input/porting/input-porting-xinput)\
[XInputOnGameInput](/reference/input/xinputongameinput/xinputongameinput_members)


## Related topics

- [XINPUT_BATTERY_INFORMATION](/es/reference/input/xinputongameinput/structs/xinput_battery_information.md)
- [XInputOnGameInput](/es/reference/input/xinputongameinput/xinputongameinput_members.md)
- [IGameInputDevice::GetBatteryState](/es/reference/input/gameinput/deprecated/interfaces/igameinputdevice/methods/igameinputdevice_getbatterystate.md)
- [GameInputBatteryState](/es/reference/input/gameinput/deprecated/structs/gameinputbatterystate.md)
- [GameInputBatteryStatus](/es/reference/input/gameinput/deprecated/enums/gameinputbatterystatus.md)
