attachconsole的问题 [英] The problem of attachconsole

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

问题描述

我需要使一个 Windows GUI 应用程序可以在控制台中运行,因此当使用命令行调用应用程序时,我将控制台附加到进程中.但是,在应用程序退出后,除非按下 ENTER 键,否则不会显示带有路径的控制台提示.有什么办法可以不用回车键直接显示带路径的提示吗?谢谢.

I need to make a windows GUI application can run in console, so I attach the console to the process when the application is invoked with a command line. However, after the application exit, the console prompt with the path doesn't show unless the ENTER key is pressed. Is there any way that the prompt with the path can directly show up without pressing the enter key? Thanks.

推荐答案

简短回答:这是不可能的.

Short answer: This is not possible.

长答案:嗯,如果你愿意稍微放宽你的要求,这是有可能的.您基本上有三个选择:

Long answer: Well, it is sort of possible if you are willing to relax your requirements a little bit. You basically have three options:

  1. 你已经做了什么.您可以将 GUI 应用程序附加到控制台,但 cmd.exe 不会等待您的应用程序退出.
  2. 创建一个 GUI 应用程序并在 GUI 应用程序中打开控制台.控制台只会在您申请时持续使用.
  3. 或者您可以稍微重构一下您的应用程序/源代码并提供两个可执行文件,一个是直接启动 GUI 的 GUI,另一个是控制台可执行文件.

这篇关于attachconsole的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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