KEYBDINPUT.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System;
  2. using System.Runtime.InteropServices;
  3. namespace Microsoft.Win32
  4. {
  5. /// <summary>
  6. /// KEYBDINPUT定义
  7. /// </summary>
  8. public static partial class NativeMethods
  9. {
  10. /// <summary>
  11. /// 键盘输入
  12. /// </summary>
  13. [StructLayout(LayoutKind.Sequential)]
  14. public struct KEYBDINPUT
  15. {
  16. /// <summary>
  17. /// Provides a virtual-key code. The code must be a value in the range 1 to 254. The Winuser.h header file provides macro definitions (VK_*) for each value. If the dwFlags member specifies KEYEVENTF_UNICODE, then wVk must be 0.
  18. /// </summary>
  19. public short wVk;
  20. /// <summary>
  21. /// Provides a hardware scan code for the key. If dwFlags specifies KEYEVENTF_UNICODE, then wScan specifies a Unicode character that is to be sent to the foreground application.
  22. /// </summary>
  23. public short wScan;
  24. /// <summary>
  25. /// Provides various aspects of a keystroke. This member can be a combination of the following values.
  26. /// </summary>
  27. public int dwFlags;
  28. /// <summary>
  29. /// Data in this member is ignored.
  30. /// </summary>
  31. public int time;
  32. /// <summary>
  33. /// Data in this member is ignored.
  34. /// </summary>
  35. public IntPtr dwExtraInfo;
  36. }
  37. }
  38. }