Eric Blake wrote: > At any rate, Bruno also had this suggestion in that thread: > > static BOOL > IsHandleConsole(HANDLE h) > { > DWORD mode; > return GetConsoleMode (h, &mode); > }
So, on the one hand, we have an officially-documented function, specified and guaranteed by MSDN. And on the other hand, we have an inference based on observing a seeming pattern. I'd recommend the first. (Also, I had a very quick step through it in a debugger, and it isn't ANDing the handle with 3; somewhere in the first few instructions it calls CsrClientCallServer, and I stopped looking at that point, but I figure it must be asing the CSRSS whether it's a console or not.) cheers, DaveK -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple