Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than user32, prefix the name with the module name and a period.
GetRawInputData (user32)
.
C# Signature:
/// <summary>
/// Function to retrieve raw input data.
/// </summary>
/// <param name="hRawInput">Handle to the raw input.</param>
/// <param name="uiCommand">Command to issue when retrieving data.</param>
/// <param name="pData">Raw input data.</param>
/// <param name="pcbSize">Number of bytes in the array.</param>
/// <param name="cbSizeHeader">Size of the header.</param>
/// <returns>0 if successful if pData is null, otherwise number of bytes if pData is not null.</returns>
[DllImport("user32.dll")]
public static extern int GetRawInputData(IntPtr hRawInput, RawInputCommand uiCommand, out RAWINPUT pData, ref int pcbSize, int cbSizeHeader);
or
/// <summary>
/// Function to retrieve raw input data.
/// </summary>
/// <param name="hRawInput">Handle to the raw input.</param>
/// <param name="uiCommand">Command to issue when retrieving data.</param>
/// <param name="pData">Raw input data.</param>
/// <param name="pcbSize">Number of bytes in the array.</param>
/// <param name="cbSizeHeader">Size of the header.</param>
/// <returns>0 if successful if pData is null, otherwise number of bytes if pData is not null.</returns>
[DllImport("user32.dll")]
public static extern int GetRawInputData(IntPtr hRawInput, RawInputCommand uiCommand, byte[] pData, ref int pcbSize, int cbSizeHeader);
VB Signature:
Declare Function GetRawInputData Lib "user32.dll" (TODO) As TODO
Alternative Managed API:
Do you know one? Please contribute it!
Notes:
The VirtualKeys (they're just mapped to the VK_* constants) and WindowsMessages enumeration have been omitted as it's quite lengthy.
RAWINPUT is incompatible with x64. See RAWINPUTHEADER.Device and RAWINPUTHEADER.wParam.
Tips & Tricks:
Please add some!
Sample Code:
protected override void WndProc(ref Message m)
{
if (m.Msg == (int)WindowMessages.RawInput) // WindowMessages.RawInput = 0x00FF (WM_INPUT)
{
RAWINPUT input = new RAWINPUT();
int outSize = 0;
int size = Marshal.SizeOf(typeof(RAWINPUT));
An enumeration which maps to the various VK_* constants.
1/27/2012 6:29:02 AM - nogChoco (MSDN forums)-81.246.135.13
C# and VB enums of many of the Windows Messages.
1/14/2017 1:02:06 PM - -62.117.213.16
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).