I am writing a windowed .NET app in C#, which runs a third party console application via the Process class, as hidden as possible (CreateNoWindow, RedirectStandardOutput, etc.).
I've redirected it's StandardInput, so I can write whatever string I want, but not function keys or other type of special keys, as they don't have a character representation. As for me, I have to send keys F1 to F4 to the console app. The solutions I've found are for windowed app (PostMessage, SendMessage).
How can I do this for my console application?
Is there anything to do with the Handle of the Process?
You can't. Function keys cannot work with stdin, an app has to call ReadConsoleInput() to be able to detect them. That no longer works when you start the process without a console window.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With