I know I can call the AttachConsole and GetStdHandle kernel32 functions to access the console screen buffers of a different console process, but if this process has its input/output/error redirected to a file or device, how can I get handles to those redirected locations instead?
To put it clear: I don’t have control on the application I’m trying to attach to, which is provided by a third party, so my chances with IPC are little.
GetStdHandlewill honour any redirection and return the redirected handle;The link also describes how to request the originals.