I am using Windows 10 with Visual Studio 2015 net 4.6 and coding in vb and wpf.
Existing code of keybd_event of user32.dll works fine in visual studio 2010.
<DllImport("user32.dll")>
Shared Sub keybd_event(bVk As Byte, bScan As Byte, dwFlags As UInteger, dwExtraInfo As Integer)
End Sub
After installing Community 2015, the code analyser says
Severity Code Description Project File Line
Warning CA1901 As it is declared in your code, parameter 'dwExtraInfo' of P/Invoke 'NativeMethods.keybd_event(Byte, Byte, UInteger, Integer)' will be 4 bytes wide on 64-bit platforms. This is not correct, as the actual native declaration of this API indicates it should be 8 bytes wide on 64-bit platforms. Consult the MSDN Platform SDK documentation for help determining what data type should be used instead of 'Integer'.
I searched web for solution. I could not get or unable to understand with my existing level of knowledge. I code only for my purposes and I am a novice.
The keybd_event is no longer used and in place SendInput is used. I tried msdn forums and the code does not work.
Question is:
1. What should I use keybd_event or SendInput
2. In case keybd_event is to be used how to rectify the warning as above.
3. if SendInput to be used, I request assistance in getting the code for the purpose.
c# code example also will do.
Thanks