你能在控制台程序中创建一个启动窗口吗?
我想在显示控制台窗口之前创建一个像窗口一样的对话框。我实际上还没有尝试过任何东西,只是想知道它是否可以显示为启动窗口。
I want to a create dialog box like window before displaying the console window. I haven't actually tried anything yet but was just wondering if it can be displayed as a start-up window.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果将 win32 应用程序编译为控制台应用程序,则在您有机会执行其他操作之前,控制台窗口将会出现。
为了解决这个问题,您需要使用 Windows 应用程序 - 默认情况下根本不会显示控制台窗口。启动后一段时间,您可以调用 AllocConsole 创建控制台窗口。
If you compile your win32 application as a console app, the console window will appear before you get a chance to do anything else.
To get around this, you need to use a windows application - this won't display a console window at all by default. Some time after startup you can then call AllocConsole to create a console window.
我不确定,但如果它已经是一个窗口应用程序,那么可能值得创建自己的控制台窗口来重定向标准 IO。看起来肯定会更好看。如果您想要常规控制台的确切行为,例如相同的复制/粘贴,则必须重新实现它。
I'm not sure, but if it's a windowed application already, it might be worth making your own console window to redirect standard IO. It'll certainly look nicer. If you want the exact behavior of the regular console, such as the same copy/paste, you'd have to reimplement it.