This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [ANNOUNCEMENT] Updated: run-1.1.11-1


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]