[ANNOUNCEMENT] Updated: run-1.1.11-1
Dave Korn
dave.korn.cygwin@googlemail.com
Thu Aug 20 14:47:00 GMT 2009
Christopher Faylor wrote:
> Is there something wrong with Cygwin's code for determining if a handle is a
> console?
>
> ...
> if (GetConsoleScreenBufferInfo (handle, &buf))
> {
> ...
> }
> else if (GetNumberOfConsoleInputEvents (handle, (DWORD *) &buf))
> {
> ...
> }
>
> It's been working pretty well for centuries.
Can't see why it wouldn't be ok. Both those functions return zero (and
GetLastError() == STATUS_INVALID_HANDLE) if what you pass isn't a console handle.
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
More information about the Cygwin
mailing list