RegisterRawInputDevices

C# Signature:

/// <summary>Function to register a raw input device.</summary>
/// <param name="pRawInputDevices">Array of raw input devices.</param>
/// <param name="uiNumDevices">Number of devices.</param>
/// <param name="cbSize">Size of the RAWINPUTDEVICE structure.</param>
/// <returns>TRUE if successful, FALSE if not.</returns>
[DllImport("user32.dll")]
public static extern bool RegisterRawInputDevices([MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)] RAWINPUTDEVICE[] pRawInputDevices, int uiNumDevices, int cbSize);

VB.NET Signature:

''' <summary>Function to register a raw input device.</summary>
''' <param name="pRawInputDevices">Array of raw input devices.</param>
''' <param name="uiNumDevices">Number of devices.</param>
''' <param name="cbSize">Size of the RAWINPUTDEVICE structure.</param>
''' <returns>True if successful, False if not.</returns>
<DllImport("user32.dll")> _
Public Shared Function RegisterRawInputDevices(<MarshalAs(UnmanagedType.LPArray, SizeParamIndex := 0)> ByVal pRawInputDevices As RAWINPUTDEVICE(), ByVal uiNumDevices As Integer, ByVal cbSize As Integer) As Boolean
End Function

Sample Code:

Última actualización