Well, I've found I need to use Raw Input which is in the User32 dll.
Unfortunately, all the samples are in C or C++. It uses structures like
[StructLayout(LayoutKind.Sequential)]
internal struct RAWINPUTDEVICE
{
[MarshalAs(UnmanagedType.U2)]
public ushort usUsagePage;
[MarshalAs(UnmanagedType.U2)]
public ushort usUsage;
[MarshalAs(UnmanagedType.U4)]
public int dwFlags;
public IntPtr hwndTarget;
}
and API calls like
[DllImport("User32.dll")]
extern static bool RegisterRawInputDevices(RAWINPUTDEVICE[] pRawInputDevice, uint uiNumDevices, uint cbSize);
In VB6 I'd have got a reference via
Declare function RegisterRawInputDevices lib "USER32" (pRawInpoutDevice as ptr, numDevices as Integer, size as Integer) as boolean
but is there a better way in
VB.net and how do I best create the structure and its pointer?