|
If you are doing this programmatically then there are Windows API functions that can be used to get the output from a console window.
ReadConsoleOutput
The ReadConsoleOutput function reads character and color attribute data from a rectangular block of character cells in a console screen buffer, and the function writes the data to a rectangular block at a specified location in the destination buffer.
BOOL ReadConsoleOutput(
HANDLE hConsoleOutput,
PCHAR_INFO lpBuffer,
COORD dwBufferSize,
COORD dwBufferCoord,
PSMALL_RECT lpReadRegion
);
If you have Visual Studio documentation, it is under Console Functions in the Platform SDK: DLLs, Processes, and Threads section.
Basically, this command does the mark/copy I described before but without the need for manual operation.
You also need to use AttachConsole(..) in your program to attach to the console of another program that you want to control via the Windows API.
|