"William Stacey [MVP]" <wi************ @gmail.com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..
How do you send Ctrl-C to a standard input stream? Just sending 03 does
not
work.
Yes it does but that isn't what you mean is it.
What you mean is how can you send an interrupt over a stream and that can't
be done. Ctrl-C is only magic if some code somewhere decides to make it so
and that code is not in any framework I/O class.
What happens normally depends on the app type but basically the app NEVER
receives a CTRL-C on ANY stream.
If your app is a forms app then ctrl-c is just another key event and there
is no standard input stream connected to the keyboard in any way.
If your app is a console app the console receives the key events and sends
them to your stdin but when it sees ctrl-c it interrupts your app instead.