C# StandardInput Sending Mofidiers

Posted by Paul Oakham on Stack Overflow See other posts from Stack Overflow or by Paul Oakham
Published on 2009-12-05T07:16:36Z Indexed on 2010/03/09 1:06 UTC
Read the original article Hit count: 224

Filed under:
|

Hi All,

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.

Any help would be great,

Cheers

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET