在 C 中获取控制台缓冲区内容 [英] Get console buffer contents in C

查看:52
本文介绍了在 C 中获取控制台缓冲区内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只是想知道是否有任何方法(在 C 中)获取控制台缓冲区的内容,最好是某种字符数组.它将被写入一个文件,所以如果我错过了一些愚蠢的事情,那就是这样做的,然后指出来.它可以是特定于 Windows 的.我正在使用 MinGW (gcc 3.4.5).

Just wondering if there is any way (in C) to get the contents of the console buffer, preferably as some kind of char array. It is going to be written to a file, so if I am missing out on something stupid that will do exactly that, then point it out. It can be Windows-specific. I am using MinGW (gcc 3.4.5).

提前致谢.

推荐答案

我认为你需要看看 win32 控制台功能,例如 GetStdHandle(), ReadConsoleOutput(), WriteConsoleOutput

I think you need to take a look at win32 console functions for example GetStdHandle(), ReadConsoleOutput(), WriteConsoleOutput etc.

这篇关于在 C 中获取控制台缓冲区内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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