控制台命令状态 [英] Console Command status

查看:78
本文介绍了控制台命令状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我已经开发了一个小型MFC应用程序,它将启动命令提示符(cmd.exe).我在使用PostMessage()创建的控制台上运行一些命令.现在,我想知道是否有可能知道以编程方式在命令提示符下执行的命令的返回值.

任何帮助表示赞赏.

谢谢,
Dev

Hi,

I have developed a small MFC app, which will launch the Command prompt (cmd.exe). i am running some commands on the console created using PostMessage(). Now, i would like to know whether it is possible to know the return value of the command i executed in the command prompt programmatically.

Any help is appreciated.

Thanks,
Dev

推荐答案

写道:​​

这将启动命令提示符(cmd.exe )

which will launch the Command prompt (cmd.exe)



您可以通过调用 AllocConsole为应用程序分配控制台,而不是运行cmd.exe. () [ ^ ].

阅读输入内容后,您可以参考本文:在控制台上进行书写和读取-使用相同的GUI应用程序cout/cin和printf/scanf [ ^ ]

如果您想对此进行进一步讨论或进一步解释,请编辑原始帖子,或使用



Instead of running the cmd.exe, you could allocate a console for your application by calling AllocConsole()[^].

With reading inputs, you could refer to this article: Writing to and read from the console - From a GUI application using the same cout/cin and printf/scanf[^]

If you would like to discuss further on this or explain something more, either edit your original post, or use the message board at the bottom of this page[^]


这篇关于控制台命令状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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