No,
SendInput
is not the same, by far. In brief,
SendKeys
is very limited (I would say, it's pretty much useless, typically used by some loosers as a workaround on the same application they write if they don't know how to write UI in a legitimate way :-)). As to the
SendInput
, it is very low-level. When you call it, the input is dispatched to some active window, no matter what it is.
You can easily use this function in C# through P/Invoke, because all the hard work is already done for you. Here:
http://www.pinvoke.net/default.aspx/user32/SendInput.html[
^].
The approach alternative to P/Invoke is using C++/CLI. You can create a mixed-mode (managed+unmanaged) project, use any C++ unmanaged API, wrap all the unmanaged code in C++/CLI "ref" or "value" classes/structures and make the public. The output of such project can be uses as a regular .NET assembly, for example, referenced by your C# project.
I hope you understand that using raw Windows API through P/Invoke or C++/CLI breaks platform compatibility of your application.
[EDIT]
You can install a Windows Hook in C# project, but you cannot install it as a global hook. According to Microsoft documentation, the hook should be installed in a separate DLL. It should be an unmanaged DLL, of course.
—SA