I need to simulate a keypress in a third party application. Let\'s say I have a C# application that needs to send an \"8\" to the Calculator application. I can\'t use the Se
There is a good article about this on CodeProject: http://www.codeproject.com/KB/cs/SendKeys.aspx
SendKeys is actually the correct idea, but you need to get the HWND (window handle) of the target window. This MSDN sample shows how to use SendKeys effectively, but not how to discover the HWND of anything other than the top-most window.
Combine the two techniques, using the CodeProject example to locate the HWND of the application you want to target, then use the MSDN article to use SendKeys to send the key strokes (or mouse events) to the target application.