XInputGetBatteryInformation
Retrieves the battery type and charge status of a wireless controller.Syntax
Parameters
dwUserIndex _In_Type: DWORD Index of the gamer associated with the device; a value in the range of 0 to
XUSER_MAX_COUNT - 1.
devType _In_Type: BYTE The type of device associated with dwUserIndex to query. Must be
BATTERY_DEVTYPE_GAMEPAD or BATTERY_DEVTYPE_HEADSET.
pBatteryInformation _Out_Type: XINPUT_BATTERY_INFORMATION* Pointer to an XINPUT_BATTERY_INFORMATION object that receives the battery information.
Return value
Type: DWORD If the function succeeds, the return value isERROR_SUCCESS.
Remarks
The values returned in pBatteryInformation specify the type of battery and the state of its charge. The charge state is valid only for a device that has a known battery type. For more information, see The XInputOnGameInput wrapper.Requirements
Header: XInputOnGameInput.h Library: xgameruntime.lib Supported platforms: XBOX One family consoles and XBOX Series consolesSee also
Porting from XInput to GameInputXInputOnGameInput
