I am using a Microsoft command-line utility to perform a task. The specific details of what the utility does and the task it performs are, I think, relatively unimportant.
There's nothing particularly magical about it. Although the C library defaults to sending output to the standard output handle, there's no obligation for a program to do so; you can always open your own handle to the console output device (CONOUT$
) instead.
See the documentation on CreateFile for more information about console devices.
In terms of capturing the output, you may be able to do something with ReadConsoleOutput and friends, but it isn't straightforward.