如何将密钥发送到没有启用RedirectStandardOutput的Windows的控制台? [英] How to Send key to a console that has no Windows with RedirectStandardOutput enabled?

查看:74
本文介绍了如何将密钥发送到没有启用RedirectStandardOutput的Windows的控制台?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何将密钥发送到没有启用RedirectStandardOutput的Windows的控制台?

谢谢。



(控制台我正在使用支持输入法)

原因是我正在制作一个运行控制台应用程序的GUI应用程序

并在实际中获取它的输出-time,和那个控制台支持输入法(比如按P来暂停,然后按下C)取消)

如果我将进程窗口设置为隐藏它不起作用,所以我用CreateNoWindows来隐藏它,但不幸的是,当CreateNoWindows启用时,我无法向控制台应用程序发送任何键。

Hi, I want to know how to Send key to console that has no Windows with RedirectStandardOutput enabled?
Thanks.

Edit : ( the console I'm using support Input method )
The reason is that I'm making a GUI application that run a console application
and fetch it's output in real-time, and that console support input method ( like pressing P to pause\resume, C to cancel )
If I set the process windows to hidden it does not work, so I used CreateNoWindows to hide it, but unfortunately I cannot send any key to the console application when CreateNoWindows enabled.

推荐答案

嗯...我可能会触及显而易见的,但是因为你重定向StandardOutput,您是否也重定向了StandardInput?您所要做的就是写下您想要的输入。
Ummm...I may be touching on the obvious, but since you redirected StandardOutput, did you also redirect StandardInput as well? All you have to do is Write the input you want.


这篇关于如何将密钥发送到没有启用RedirectStandardOutput的Windows的控制台?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆