@msdn=http://search.microsoft.com/search/results.aspx?qu=$$$ @pinvoke=http://pinvoke.net/$$$.htm Summary: The GetRawInputDeviceInfo function gets information about the raw input device. !!!!C# Signature: [DllImport("user32.dll", SetLastError=true)] static extern uint GetRawInputDeviceInfo(IntPtr hDevice, uint uiCommand, IntPtr pData, ref uint pcbSize); !!!!VB Signature: Declare Function GetRawInputDeviceInfo Lib "user32.dll" Alias "GetRawInputDeviceInfoW" (ByVal hDevice As IntPtr, ByVal uiCommand As DeviceInfoTypes, ByVal pData As IntPtr, ByRef pcbSize As UInteger) As Integer !!!!VB User-Defined Types: Public Enum DeviceInfoTypes As UInteger RIDI_PREPARSEDDATA = &H20000005 RIDI_DEVICENAME = &H20000007 RIDI_DEVICEINFO = &H2000000B End Enum !!!!Alternative Managed API: Do you know one? Please contribute it! !!!!Notes: None. !!!!Tips & Tricks: Please add some! !!!!Sample Code: [StructLayout(LayoutKind.Sequential)] internal struct RID_DEVICE_INFO_HID { [MarshalAs(UnmanagedType.U4)] public int dwVendorId; [MarshalAs(UnmanagedType.U4)] public int dwProductId; [MarshalAs(UnmanagedType.U4)] public int dwVersionNumber; [MarshalAs(UnmanagedType.U2)] public ushort usUsagePage; [MarshalAs(UnmanagedType.U2)] public ushort usUsage; } [StructLayout(LayoutKind.Sequential)] internal struct RID_DEVICE_INFO_KEYBOARD { [MarshalAs(UnmanagedType.U4)] public int dwType; [MarshalAs(UnmanagedType.U4)] public int dwSubType; [MarshalAs(UnmanagedType.U4)] public int dwKeyboardMode; [MarshalAs(UnmanagedType.U4)] public int dwNumberOfFunctionKeys; [MarshalAs(UnmanagedType.U4)] public int dwNumberOfIndicators; [MarshalAs(UnmanagedType.U4)] public int dwNumberOfKeysTotal; } [StructLayout(LayoutKind.Sequential)] internal struct RID_DEVICE_INFO_MOUSE { [MarshalAs(UnmanagedType.U4)] public int dwId; [MarshalAs(UnmanagedType.U4)] public int dwNumberOfButtons; [MarshalAs(UnmanagedType.U4)] public int dwSampleRate; [MarshalAs(UnmanagedType.U4)] public int fHasHorizontalWheel; } [StructLayout(LayoutKind.Explicit)] internal struct RID_DEVICE_INFO { [FieldOffset(0)] public int cbSize; [FieldOffset(4)] public int dwType; [FieldOffset(8)] public RID_DEVICE_INFO_MOUSE mouse; [FieldOffset(8)] public RID_DEVICE_INFO_KEYBOARD keyboard; [FieldOffset(8)] public RID_DEVICE_INFO_HID hid; } Documentation: GetRawInputDeviceInfo@msdn on MSDN
Edit user32.GetRawInpu...
You do not have permission to change this page. If you feel this is in error, please send feedback with the contact link on the main page.