So let's use this code:
Console.ReadKey(true);
//Cancel the ReadKey prompt
Console.WriteLine("ReadKey was cancelled.");
Upon running the program, the only thing that should happen is that the output ReadKey was cancelled.
should appear. How can I achieve this? Is it even possible?
Thanks in advance.
The only way I can see you could do this is using System.Windows.Forms.SendKeys.Send(), however this doesn't work 'out of the box' for a console app because they don't manage windows messages, if you try it you'll see the exception. There could be a way to implement this yourself using windows API's.