问题
How can I check if a CLI program, that I just started with CreateProcess(), is waiting for input from stdin with the Windows C API?
回答1:
as some of the comments above have said, you cannot check if your program is waiting for stdin once it has already started waiting. You could use an event handler or you could simply have a read from stdin with a timeout, where on occurrence of the timeout you flag that you are waiting for input and start waiting with a timeout again.
来源:https://stackoverflow.com/questions/10803122/how-can-i-check-if-a-cli-program-is-waiting-for-input-from-stdin