有没有办法将STD熄灭控制台?

发布于 2025-01-24 10:14:50 字数 163 浏览 3 评论 0原文

我想知道是否有Win32功能可以阻止控制台打开。它已经为int winapi wwinmain输入点功能做到了这一点,但是使用常规int main输入点功能,控制台本身会打开。我想知道Windows是否具有关闭它的功能。我正在使用llvm clang。

I would like to know if there is a Win32 function to stop the console from opening. It already does this for a int WINAPI wWinMain entry point function but with the regular int main entry point function, the console opens by itself. I want to know if Windows has a function to close it. I am using llvm clang.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

风和你 2025-01-31 10:14:50

这可能由编译器控制。

例如,在 gcc文档 -mconsole如果他想要控制台应用程序或flag -mwindows如果他想要GUI应用程序,而没有任何控制台。

您可能对Microsoft编译器有类似的标志,您可能需要阅读文档。

This might be controlled by the compiler.

For example, in the GCC documentation one can use the flag -mconsole if he wants a console application or the flag -mwindows if he wants a GUI application, without any console.

You probably have similar flags for Microsoft Compiler, you might want to read the documentation.

紫罗兰の梦幻 2025-01-31 10:14:50

我找到了解决方案。 Linker命令-wl,/子系统:Windows,/条目:MAINCRTSTARTUP
会告诉它是GUI应用

I found the solution. The linker command -Wl,/subsystem:windows,/entry:mainCRTStartup
will tell it that it is a GUI app but to use int main as the entry point

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