Hello
I know I can read console buffer using ReadConsoleOutput function. Is there any way to be notified when console app is outputing text ? Currently I need to set timer and scan the console buffer all the time.
Ty.
Hello
I know I can read console buffer using ReadConsoleOutput function. Is there any way to be notified when console app is outputing text ? Currently I need to set timer and scan the console buffer all the time.
Ty.
Not 100% sure I totally understand what you're trying to do - would this help?
Process process = new Process();
process.StartInfo.RedirectStandardOutput = true;
process.OutputDataReceived +=
new DataReceivedEventHandler(HandleConsoleOutput);
process.Start( );
and then handle all output being written to the console output by that process using this handler:
void HandleConsoleOutput(object sender, DataReceivedEventArgs e)
{
// Std output arrives here
}
Marc