GetRawInputData function

Retrieves the raw input from the specified device.

Syntax

UINT GetRawInputData(
  HRAWINPUT hRawInput,
  UINT      uiCommand,
  LPVOID    pData,
  PUINT     pcbSize,
  UINT      cbSizeHeader
);

Parameters

hRawInput

Type: HRAWINPUT

A handle to the RAWINPUT structure. This comes from the lParam in WM_INPUT.

uiCommand

Type: UINT

The command flag. This parameter can be one of the following values.

Value Meaning
RID_HEADER
0x10000005
Get the header information from the RAWINPUT structure.
RID_INPUT
0x10000003
Get the raw data from the RAWINPUT structure.

pData

Type: LPVOID

A pointer to the data that comes from the RAWINPUT structure. This depends on the value of uiCommand. If pData is NULL, the required size of the buffer is returned in *pcbSize.

pcbSize

Type: PUINT

The size, in bytes, of the data in pData.

cbSizeHeader

Type: UINT

The size, in bytes, of the RAWINPUTHEADER structure.

Return Value

Type: UINT

If pData is NULL and the function is successful, the return value is 0. If pData is not NULL and the function is successful, the return value is the number of bytes copied into pData.

If there is an error, the return value is (UINT)-1.

Remarks

GetRawInputData gets the raw input one RAWINPUT structure at a time. In contrast, GetRawInputBuffer gets an array of RAWINPUT structures.

Requirements

   
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Target Platform Windows
Header winuser.h (include Windows.h)
Library User32.lib
DLL User32.dll

See Also

Conceptual

GetRawInputBuffer

RAWINPUT

RAWINPUTHEADER

Raw Input

Reference