Desktop Functions:

   Smart Device Functions:

Show Recent Changes
Subscribe (RSS)
Misc. Pages
Helpful Tools
Suggested Reading
Website TODO List
Support Forum
Download Visual Studio Add-In

Terms of Use
Privacy Policy
GetRawInputDeviceInfo (user32)
TODO - a short description

C# Signature:

    public static extern uint GetRawInputDeviceInfo(int deviceHandle, uint command, ref DeviceInfo data, ref uint dataSize);

VB Signature:

Declare Function GetRawInputDeviceInfo  Lib "user32.dll" (TODO) As TODO

User-Defined Types:

        public struct DeviceInfo
            public int Size;
            public int Type;

            public DeviceInfoMouse MouseInfo;
            public DeviceInfoKeyboard KeyboardInfo;
            public DeviceInfoHID HIDInfo;

        public struct DeviceInfoMouse
            public uint ID;
            public uint NumberOfButtons;
            public uint SampleRate;

        public struct DeviceInfoKeyboard
            public uint Type;
            public uint SubType;
            public uint KeyboardMode;
            public uint NumberOfFunctionKeys;
            public uint NumberOfIndicators;
            public uint NumberOfKeysTotal;

        public struct DeviceInfoHID
            public uint VendorID;
            public uint ProductID;
            public uint VersionNumber;
            public ushort UsagePage;
            public ushort Usage;

Alternative Managed API:

Do you know one? Please contribute it!



Tips & Tricks:

Please add some!

Sample Code:

    uint size = Marshal.SizeOf(typeof(User32.DeviceInfo));
    User32.DeviceInfo di = new User32.DeviceInfo();
    di.Size = Marshal.SizeOf(typeof(User32.DeviceInfo));
    User32.GetRawInputDeviceInfo(device.hDevice, User32.RIDI_DEVICEINFO, ref di, ref size);


Please edit this page!

Do you have...

  • helpful tips or sample code to share for using this API in managed code?
  • corrections to the existing content?
  • variations of the signature you want to share?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).

Access directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version