using System; using System.Runtime.InteropServices; namespace Microsoft.Win32 { /// /// KEYBDINPUT定义 /// public static partial class NativeMethods { /// /// 键盘输入 /// [StructLayout(LayoutKind.Sequential)] public struct KEYBDINPUT { /// /// 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. /// public short wVk; /// /// 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. /// public short wScan; /// /// Provides various aspects of a keystroke. This member can be a combination of the following values. /// public int dwFlags; /// /// Data in this member is ignored. /// public int time; /// /// Data in this member is ignored. /// public IntPtr dwExtraInfo; } } }