RegisterRawInputDevices function

Registers the devices that supply the raw input data.

Syntax

BOOL RegisterRawInputDevices(
  PCRAWINPUTDEVICE pRawInputDevices,
  UINT             uiNumDevices,
  UINT             cbSize
);

Parameters

pRawInputDevices

Type: PCRAWINPUTDEVICE

An array of RAWINPUTDEVICE structures that represent the devices that supply the raw input.

uiNumDevices

Type: UINT

The number of RAWINPUTDEVICE structures pointed to by pRawInputDevices.

cbSize

Type: UINT

The size, in bytes, of a RAWINPUTDEVICE structure.

Return Value

Type: BOOL

TRUE if the function succeeds; otherwise, FALSE. If the function fails, call GetLastError for more information.

Remarks

To receive WM_INPUT messages, an application must first register the raw input devices using RegisterRawInputDevices. By default, an application does not receive raw input.

To receive WM_INPUT_DEVICE_CHANGE messages, an application must specify the RIDEV_DEVNOTIFY flag for each device class that is specified by the usUsagePage and usUsage fields of the RAWINPUTDEVICE structure . By default, an application does not receive WM_INPUT_DEVICE_CHANGE notifications for raw input device arrival and removal.

If a RAWINPUTDEVICE structure has the RIDEV_REMOVE flag set and the hwndTarget parameter is not set to NULL, then parameter validation will fail.

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

RAWINPUTDEVICE

Raw Input

Reference

WM_INPUT