title: In Windows, how to get a standard device handle for a different console process?
body: <p>I know I can call the <code>AttachConsole</code> and  <code>GetStdHandle</code> 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?</p>
  
  <p>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.</p>