你能在控制台程序中创建一个启动窗口吗?

发布于 2024-08-23 16:55:19 字数 66 浏览 1 评论 0原文

我想在显示控制台窗口之前创建一个像窗口一样的对话框。我实际上还没有尝试过任何东西,只是想知道它是否可以显示为启动窗口。

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

计㈡愣 2024-08-30 16:55:19

如果将 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.

静待花开 2024-08-30 16:55:19

我不确定,但如果它已经是一个窗口应用程序,那么可能值得创建自己的控制台窗口来重定向标准 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文