.NET StandardInput Sending Modifiers
- by Paul Oakham
We have some legacy software which depends on sending keystrokes to a DOS window and then scraping the screen. I am trying to re-create the software by redirecting the input and output streams of the process directly to my application. This part I have managed fine using:
_Process = new Process();
{
_Process.StartInfo.FileName = APPLICATION;
_Process.StartInfo.RedirectStandardOutput = true;
_Process.StartInfo.RedirectStandardInput = true;
_Process.StartInfo.RedirectStandardError = true;
_Process.StartInfo.UseShellExecute = false;
_Process.StartInfo.CreateNoWindow = true;
_Process.OutputDataReceived += new DataReceivedEventHandler(_Process_OutputDataReceived);
_Process.ErrorDataReceived += new DataReceivedEventHandler(_Process_ErrorDataReceived);
}
My problem is I need to send some command modifiers such as Ctrl, ALT and Space as well as F1-12 to this process but am unsure how. I can send basic text and I receive response's fine. I just need to emulate these modifiers.