SendInput and 64bits

前端 未结 2 1376
长发绾君心
长发绾君心 2020-11-27 21:17

Below is an extract of some code I am using to simulate key presses via the SendInput API. This works correctly if I set my application to compile for an x86 CPU, but doesn\

2条回答
  •  一整个雨季
    2020-11-27 21:43

    dwExtraInfo is a pointer.
    Therefore, it needs to be 4 bytes wide in 32-bit code and 8 bytes in 64-bit code.

    To do that in C#, use IntPtr (not uint, which is always 4 bytes)

提交回复
热议问题