> ## 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 o tipo de bateria e o status de carga de um controle sem fio.

<a id="syntaxSection" />

## Sintaxe

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

<a id="parametersSection" />

### Parâmetros

*dwUserIndex*   \_In\_\
Tipo: DWORD

Índice do jogador associado ao dispositivo; um valor no intervalo de 0 a `XUSER_MAX_COUNT - 1`.

*devType*   \_In\_\
Tipo: BYTE

O tipo de dispositivo associado a *dwUserIndex* a ser consultado. Deve ser `BATTERY_DEVTYPE_GAMEPAD` ou `BATTERY_DEVTYPE_HEADSET`.

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

Ponteiro para um objeto [XINPUT\_BATTERY\_INFORMATION](/pt-BR/reference/input/xinputongameinput/structs/xinput_battery_information) que recebe as informações da bateria.

<a id="retvalSection" />

### Valor retornado

Tipo: DWORD

Se a função for bem-sucedida, o valor retornado será `ERROR_SUCCESS`.

<a id="remarksSection" />

## Comentários

Os valores retornados em *pBatteryInformation* especificam o tipo de bateria e o estado de sua carga. O estado de carga é válido apenas para um dispositivo que tenha um tipo de bateria conhecido.

Para obter mais informações, consulte [O wrapper XInputOnGameInput](/pt-BR/build/core-features/common/input/porting/input-porting-xinput#xinputWrapperSection).

<a id="requirementsSection" />

## Requisitos

**Cabeçalho:** XInputOnGameInput.h

**Biblioteca:** xgameruntime.lib

**Plataformas com suporte:** consoles da família XBOX One e consoles XBOX Series

<a id="seealsoSection" />

## Confira também

[Portabilidade do XInput para o GameInput](/pt-BR/build/core-features/common/input/porting/input-porting-xinput)\
[XInputOnGameInput](/pt-BR/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)
