title: How do I detect when output is being redirected?
body: <p>I have a Win32 application written in C that can have its console output <em>via printf()</em> redirected to a log file.</p>
  
  <p>It would be nice if I could have my app. detect if it had been started with or without a redirect '>'.</p>
  
  <p>Any ideas?</p>