Win32编程隐藏控制台窗口 [英] Win32 programming hiding console window

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

问题描述

林学习C ++和我犯了一个新的计划,我删除了一些code,现在我的控制台窗口不会躲,有没有办法让它在启动时没有隐藏他们看到它

Im learning C++ and i made a New program and i deleted some of the code and now my console window will not hide is there a way to make it hide on startup without them seeing it

推荐答案

如果你正在写一个控制台程序,你想从它开始与控制台断开你的程序中,然后调用的 FreeConsole 。最终,你可能不会满足于什么功能确实,但是这是字面回答你问的问题。

If you're writing a console program and you want to disconnect your program from the console it started with, then call FreeConsole. Ultimately, you probably won't be satisfied with what that function really does, but that's the literal answer to the question you asked.

如果你正在写一个程序,你永远不希望有摆在首位控制台,然后配置你的项目,所以它不是一个控制台程序。 Consoleness是EXE文件的一个属性。操作系统读取设置并决定是否要在任何您的code的分配控制台程序的以往运行的,所以你不能在程序中控制它。有时,一个非控制台程序被称为GUI程序,所以你可能找你的开发环境的配置选项控制台和GUI之间做出选择。将其设置为GUI没有的需要的你有任何用户界面可言,虽然。设置只是控制你的程序是否有一个控制台启动。

If you're writing a program that you never want to have a console in the first place, then configure your project so that it is not a console program. "Consoleness" is a property of the EXE file. The OS reads that setting and decides whether to allocate a console for your program before any of your code ever runs, so you can't control it within the program. Sometimes a non-console program is called a "GUI program," so you might look for a choice between "console" and "GUI" in the configuration options of your development environment. Setting it to GUI doesn't require that you have any user interface at all, though. The setting merely controls whether your program starts with a console.

如果你试图写一个程序,有时有一个控制台,有时没有,那么请参阅前面一个问题,<一个href=\"http://stackoverflow.com/questions/493536/can-one-executable-be-both-a-console-and-gui-app\">Can一个可执行既是一个控制台和GUI应用程序?

If you're trying to write a program that can sometimes have a console and sometimes not, then please see an earlier question, Can one executable be both a console and GUI app?

这篇关于Win32编程隐藏控制台窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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