Clearing NT Buffer

Matt Minnis mminnis@prefres.com
Mon Sep 18 11:35:00 GMT 2000


I have been working to find a way to get the WinNT console output buffer to 
reset the cursor when the clear command is issued.  I can get the screen 
cleared just fine.  Currently the screen and buffer clears but the cursor 
is wherever it was at before, not at the very beginning of the buffer.


How do I get the Handle for the current console?

   hConsole=GetStdHandle(STD_OUTPUT_HANDLE);//stdout;
   bSuccess = SetConsoleCursorPosition( hConsole, coordScreen );

This does not seem to work, since the SetConsoleCursorPosition always fails.

Is there a better way to get the NT console's handle for the current 
console window?
Is there a better way to return the cursor to the top of the buffer?

The ANSI sequence for clearing the screen, then moving the cursor to 0,0 
works on 95 as expected.  On NT it clears the screen and buffer, but does 
not set the cursor to the 0,0 of the buffer it does it to the 0,0 of the 
console window.

Thanks,

Matt Minnis


At 12:56 PM 9/18/2000, you wrote:
>On Fri, Sep 15, 2000 at 12:01:52PM +0100, Mortimer, Andy wrote:
> >I've just bitten the bullet and upgraded from a b20.1 snapshot release 
> to the
> >latest and greatest net release, and almost everything is much improved 
> (so I
> >don't really want to go back ... ;-)  Unfortunately, I've started having 
> various
> >problems with the error message:
> >
> >1184486202 [sig] bash 28849 sig_send: wait for sig_complete event 
> failed, sig 11, rc 258, Win32 error 0
>
>I don't know what is causing this but I can see that there is apparently
>a SIGSEGV in cygwin's signal handling thread.
>
>I've made a change to recent snapshots which will cause cygwin to core dump
>in this situation rather than try to send a signal to itself which is never
>caught.
>
>If you have the time, please try out a snapshot.
>
>cgf
>
>--
>Want to unsubscribe from this list?
>Send a message to cygwin-unsubscribe@sourceware.cygnus.com

Cthulhu for President. Why settle for a lesser evil?

=========================================================
Preferred Resources          (314) 567-7600 phone
701 Emerson rd.              (314) 993-6699 fax
Suite 475                      mminnis@prefres.com
St. Louis, MO
63141
=========================================================


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com



More information about the Cygwin mailing list