Function Reference


Retrieves information about the raw input device

#include <WinAPISys.au3>
_WinAPI_GetRawInputDeviceInfo ( $hDevice, $pBuffer, $iLength, $iFlag )


$hDevice A handle to the raw input device. This comes from the "lParam" of the WM_INPUT message, from the
"$hDevice" member of the $tagRAWINPUTHEADER structure, or from the _WinAPI_EnumRawInputDevices() function.
$pBuffer A pointer to the buffer that receives an information specified by a command flag (see below).
If this parameter is 0, the function returns the required size of the buffer, in bytes or characters.
$iLength The size of the buffer, in bytes. For $RIDI_DEVICENAME only, this value is the character count,
including null-terminating character (not the byte count).
$iFlag The command flag that specifies what information will be returned.
This parameter can be one of the following values.

Return Value

Success: The number of bytes or characters required or copied into the buffer.
Failure: 0 and sets the @error flag to non-zero, call _WinAPI_GetLastError() to get extended error information.

See Also

Search GetRawInputDeviceInfo in MSDN Library.


#include <APISysConstants.au3>
#include <Array.au3>
#include <WinAPISys.au3>

Local $tText, $aData = _WinAPI_EnumRawInputDevices()

If IsArray($aData) Then
    ReDim $aData[$aData[0][0] + 1][3]
    $tText = DllStructCreate('wchar[256]')
    For $i = 1 To $aData[0][0]
        If _WinAPI_GetRawInputDeviceInfo($aData[$i][0], $tText, 256, $RIDI_DEVICENAME) Then
            $aData[$i][2] = DllStructGetData($tText, 1)
            $aData[$i][2] = ''


_ArrayDisplay($aData, '_WinAPI_EnumRawInputDevices')