Tag: user32

通过user32.dll中的SendInput发送密钥

我正在使用此板作为演示目的的键盘。 无论如何,使长话短说一切正常,除了极less数情况下。 我用位于user32.dll中的SendInput函数发送击键。 所以我的程序看起来像: static void Main(string[] args) { Console.Write("Press enter an on the next secont the key combination shift+end will be send"); Console.Read(); Thread.Sleep(1000); SendKeyDown(KeyCode.SHIFT); SendKeyPress(KeyCode.END); SendKeyUp(KeyCode.SHIFT); Console.Read(); Console.Read(); } [DllImport("user32.dll", SetLastError = true)] private static extern uint SendInput(uint numberOfInputs, INPUT[] inputs, int sizeOfInputStructure); /// <summary> /// simulate key press /// </summary> /// <param […]