日期:2014-05-18 浏览次数:21483 次
/// <summary> /// 键盘事件 /// </summary> /// <param name="bvk"></param> /// <param name="bScan"></param> /// <param name="dwFlags"> 0 为按下,2为释放</param> /// <param name="dwExtraInfo">一般情况下设成为 0</param> [DllImport("user32.dll")] public extern static void keybd_event(byte bvk, byte bScan, int dwFlags, int dwExtraInfo); //调用 keybd_event((byte)Keys.LWin, 0, 0, 0); //按下LWIN keybd_event((byte)Keys.R, 0, 0, 0); //按下R keybd_event((byte)Keys.LWin, 0, 2, 0); //释放LWIN keybd_event((byte)Keys.R, 0, 2, 0); //释放R