Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我看到了几种捕获已启动控制台应用程序输出的方法。但它们都是“单色”解决方案,例如 FFMPEG 可能会产生彩色输出。如何捕捉颜色?
您必须挂钩所有控制台输出函数(例如,WriteConsoleOutput;有关它们的列表,请参见 MSDN 库)以访问进程的屏幕缓冲区,然后通过共享内存或管道将截获的输出传递给您的应用程序。AFAIK,没有其他方法可以访问另一个应用程序的控制台输出句柄。