INPUT.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System.Runtime.InteropServices;
  2. namespace Microsoft.Win32
  3. {
  4. /// <summary>
  5. /// INPUT定义
  6. /// </summary>
  7. public static partial class NativeMethods
  8. {
  9. /// <summary>
  10. /// 输入数据,如果是64位系统应该改为[FieldOffset(8)]
  11. /// </summary>
  12. [StructLayout(LayoutKind.Explicit)]
  13. public struct INPUT
  14. {
  15. /// <summary>
  16. /// Indicates the type of device information this structure carries. It is one of the following values.
  17. /// </summary>
  18. [FieldOffset(0)]
  19. public int type;
  20. /// <summary>
  21. /// MOUSEINPUT structure that contains information about simulated mouse input.
  22. /// </summary>
  23. [FieldOffset(4)]
  24. public MOUSEINPUT mi;
  25. /// <summary>
  26. /// KEYBDINPUT structure that contains information about simulated keyboard input.
  27. /// </summary>
  28. [FieldOffset(4)]
  29. public KEYBDINPUT ki;
  30. /// <summary>
  31. /// HARDWAREINPUT structure that contains information about a simulated input device message.
  32. /// </summary>
  33. [FieldOffset(4)]
  34. public HARDWAREINPUT hi;
  35. }
  36. }
  37. }