24 int iBufferHeight, iScrollHeight, iClearFrom, iClearTo, iClearPos;
33 int move_size = ((remaining < rows) ? remaining : rows);
45 dwDest.X = dwDest.Y = 0;
59 if( iBufferHeight <= rows ) {
68 srScroll.Left = dwDest.X;
69 srScroll.Top = (SHORT) (dwDest.Y + rows);
71 iScrollHeight = srScroll.Bottom - srScroll.Top + 1;
72 if( iScrollHeight < rows ) {
75 iClearFrom = dwDest.Y + iScrollHeight;
76 iClearTo = srScroll.Bottom + 1;
78 iClearFrom = iClearTo = 0;
82 FillChar.Char.AsciiChar = 32;
84 ScrollConsoleScreenBuffer( hnd, &srScroll,
NULL, dwDest, &FillChar );
89 if( iClearFrom!=iClearTo ) {
93 for( iClearPos=iClearFrom; iClearPos!=iClearTo; ++iClearPos ) {
95 COORD coord = { x1, (SHORT) iClearPos };
96 FillConsoleOutputAttribute( hnd, attr, width, coord, &written);
97 FillConsoleOutputCharacter( hnd,
' ', width, coord, &written );
113 const char *pachText = (
const char *)
buffer;
114 CHAR_INFO *lpBuffer = alloca(
sizeof(CHAR_INFO) * length );
116 COORD dwBufferSize = { (SHORT) length, 1 };
117 COORD dwBufferCoord = { 0, 0 };
118 SMALL_RECT srWriteRegion = {
121 (SHORT) (handle->
Coord.
X + length - 1),
127 for( i=0; i!=length; ++i ) {
128 CHAR_INFO *pCharInfo = lpBuffer + i;
129 pCharInfo->Attributes = wAttributes;
130 pCharInfo->Char.AsciiChar = pachText[i];
132 result = WriteConsoleOutput( hnd,
142 const char *pachText = (
const char *) buffer;
143 int win_left, win_top, win_cols, win_rows;
144 int view_top, view_bottom;
159 DWORD dwBytesWritten;
167 pachText += dwBytesWritten;
168 len -= dwBytesWritten;
181 hooks.
Border.
Top = win_top + view_top - 1;
194 CONSOLE_SCREEN_BUFFER_INFO screen_info;
203 hooks.
Coord.
X = screen_info.dwCursorPosition.X;
204 hooks.
Coord.
Y = screen_info.dwCursorPosition.Y;
235 COORD dwCoord = { (SHORT) hooks.
Coord.
X, (SHORT) hooks.
Coord.
Y };
236 SetConsoleCursorPosition( info.
hOutput,
244 SMALL_RECT srWindow =
251 SetConsoleWindowInfo( info.
hOutput,
TRUE, &srWindow );