SendKeys
is a pretty bad thing, by a number of reasons. The really universal ways to simulate input events in Windows is
SendInput
:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms646310%28v=vs.85%29.aspx[
^].
You can use it via P/Invoke, which is already done for you:
http://www.pinvoke.net/default.aspx/user32.sendinput[
^].
And a word of warning for you: try to stay away from technology abuse. The cases when you need to simulate input are quite rare; playing keyboard (keyboard/mouse) macro is one of them; another application could be UI testing tools. Simulation of input should not be used in UI development, for example.
—SA