Windows编程中的Console是什么意思?
我的 Windows 控制台有问题...在 Windows api 中,控制台 是否始终必须是屏幕或键盘,还是可以是任何字符缓冲区或文本文件之类的东西?
如果我更具体的话
,Windows API 中的 SetConsoleMode 功能有一个名为 hConsoleHandle 的参数,它有一个名为 ENABLE_ECHO_INPUT 的标志,可用于回显我们在屏幕上读到的每个字符..所以我认为在Windows系统编程中,控制台的含义超出了正常的含义...那么我是在写吗?如果是的话,真正的含义是什么..?
再次感谢
I've got a problem with windows consoles... In windows api, does a console always has to be a screen or a keyboard or can it be any character buffer or something like a text file ?
thanx
If I be more specific, SetConsoleMode fnction in windows api has a parameter called hConsoleHandle which has a flag called ENABLE_ECHO_INPUT that can be used to echo every character we read to the screen.. So I thought in windows system programming, Console means something more than it's normal meaning... So am I write and if so what is the true meaning..?
thanx again
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
不,“控制台”意味着具有基于文本的界面的应用程序。
维基百科上的 Win32 Console 表示该标签指定在 Windows API 下运行的文本模式程序,并且例如,将使用像
WriteConsole
这样的函数,而不是printf
或cout
。因此,控制台是相同的,但底层库不同。
No, a "console" implies an application that has a text-based interface.
Win32 Console on Wikipedia says that that label specifies a text mode program that runs under the Windows API, and would use, for example, a function like
WriteConsole
instead ofprintf
orcout
.So, the console's the same, but the underlying library is different.
正如此处详细描述的那样
所以你的答案就在那里。正如之前所问的,请尝试更好地解释您的背景、您的目标以及您的想法,这样也许我们可以为您提供更多帮助。
As it's well described here
so you have your answer right there. As asked before, try to explain better your context, your objective and what is your idea, so maybe we can help you out more.
在 Windows 下,控制台始终是一个类似于命令提示符窗口的窗口。您可以在 Windows 程序中打开该东西并对其进行读写。它不是缓冲区或文本文件,但您可以编写缓冲区或文本文件,然后将该实体传输到控制台。
以下是在访问控制台窗口时可以使用的 C 语言函数:
Under Windows, the console is always a window that resembles the Command Prompt window. You can open and read and write from/to that thing in your windows program. It's not a buffer or a text file, but you can write a buffer or text file and then transfer that entity to the console.
Here are the C-language functions you can use when you address the console window: