RegisterRawInputDevices function (Windows)

Switch View :
ScriptFree
RegisterRawInputDevices function

Applies to: desktop apps only

Registers the devices that supply the raw input data.

Syntax

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

Parameters

pRawInputDevices [in]

Type: PCRAWINPUTDEVICE

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

uiNumDevices [in]

Type: UINT

The number of RAWINPUTDEVICE structures pointed to by pRawInputDevices.

cbSize [in]

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

Minimum supported server

Windows Server 2003

Header

Winuser.h (include Windows.h)

Library

User32.lib

DLL

User32.dll

See also

Reference
RAWINPUTDEVICE
WM_INPUT
Conceptual
Raw Input

 

 

Send comments about this topic to Microsoft

Build date: 3/6/2012

Community Content

ChGu
C# Declaration
[DllImport("user32.dll")]
extern bool RegisterRawInputDevices(RAWINPUTDEVICE[] pRawInputDevices,
uint uiNumDevices,
uint cbSize);

Đonny
Visual Basic 9 Declaration
Public Declare Auto Function RegisterRawInputDevices Lib "User32.dll" (ByVal pRawInputDevice As RAWINPUTDEVICE(), ByVal uiNumDevices As UInteger, ByVal cbSize As UInteger) As Boolean