Send Keys to another application without activating it
Posted on 2011-03-25
I am writing a WPF application using VB .NET and am trying to find sample code for sending (if possible) keystrokes (sometimes single characters, sometimes whole strings and sometimes control keystrokes such as ENTER) to another application.
We have a legacy application that does not expose an API for automation/interop and as such until we redevelop, have to hack it by sending keystrokes. However, we would prefer to avoid using AppActivate seeing that we cannot guarantee the popping up of the application at random intervals will not cause other issues when someone is using the computer.
So in short, is it possible to send (complex) keystrokes to another application without activating it using VB .NET and if so, how?