<html>
Under win32: look at<br>
<a href="http://msdn.microsoft.com/library/default.asp" eudora="autourl">http://msdn.microsoft.com/library/default.asp</a>
(only using IE5.0/5.5 or Netscape 4.76)<br>
On left-hand-side TOC window, navigate to<br>
Platform SDK<br>
- Base services<br>
-- Files and I/O<br>
--- Consoles and Character-Mode Support<br>
---- Using the Console<br>
<br>
Below is the C example for reading and writing block of characters and attributes, using ReadConsoleInput and WriteConsoleOutput.<br>
<br>
MSDN is a good source of Win32 info, alas I have no idea about GO32.<br>
<br>
<font face="Courier New, Courier">#include <windows.h> <br>
<br>
VOID main(void) <br>
{ <br>
HANDLE hStdout, hNewScreenBuffer; <br>
SMALL_RECT srctReadRect; <br>
SMALL_RECT srctWriteRect; <br>
CHAR_INFO chiBuffer[160]; // [2][80]; <br>
COORD coordBufSize; <br>
COORD coordBufCoord; <br>
BOOL fSuccess; <br>
<br>
// Get a handle to the STDOUT screen buffer to copy from and <br>
// create a new screen buffer to copy to. <br>
<br>
hStdout = GetStdHandle(STD_OUTPUT_HANDLE); <br>
hNewScreenBuffer = CreateConsoleScreenBuffer( <br>
GENERIC_READ | // read/write access <br>
GENERIC_WRITE, <br>
0, // not shared <br>
NULL, // no security attributes <br>
CONSOLE_TEXTMODE_BUFFER, // must be TEXTMODE <br>
NULL); // reserved; must be NULL <br>
if (hStdout == INVALID_HANDLE_VALUE || <br>
hNewScreenBuffer == INVALID_HANDLE_VALUE) <br>
{<br>
MyErrorExit("CreateConsoleScreenBuffer"); <br>
}<br>
<br>
// Make the new screen buffer the active screen buffer. <br>
<br>
if (! SetConsoleActiveScreenBuffer(hNewScreenBuffer) ) <br>
MyErrorExit("SetConsoleActiveScreenBuffer"); <br>
<br>
// Set the source rectangle. <br>
<br>
srctReadRect.Top = 0; // top left: row 0, col 0 <br>
srctReadRect.Left = 0; <br>
srctReadRect.Bottom = 1; // bot. right: row 1, col 79 <br>
srctReadRect.Right = 79; <br>
<br>
// The temporary buffer size is 2 rows x 80 columns. <br>
<br>
coordBufSize.Y = 2; <br>
coordBufSize.X = 80; <br>
<br>
// The top left destination cell of the temporary buffer is <br>
// row 0, col 0. <br>
<br>
coordBufCoord.X = 0; <br>
coordBufCoord.Y = 0; <br>
<br>
// Copy the block from the screen buffer to the temp. buffer. <br>
<br>
fSuccess = ReadConsoleOutput( <br>
hStdout, // screen buffer to read from <br>
chiBuffer, // buffer to copy into <br>
coordBufSize, // col-row size of chiBuffer <br>
coordBufCoord, // top left dest. cell in chiBuffer <br>
&srctReadRect); // screen buffer source rectangle <br>
if (! fSuccess) <br>
MyErrorExit("ReadConsoleOutput"); <br>
<br>
// Set the destination rectangle. <br>
<br>
srctWriteRect.Top = 10; // top lt: row 10, col 0 <br>
srctWriteRect.Left = 0; <br>
srctWriteRect.Bottom = 11; // bot. rt: row 11, col 79 <br>
srctWriteRect.Right = 79; <br>
<br>
// Copy from the temporary buffer to the new screen buffer. <br>
<br>
fSuccess = WriteConsoleOutput( <br>
hNewScreenBuffer, // screen buffer to write to <br>
chiBuffer, // buffer to copy from <br>
coordBufSize, // col-row size of chiBuffer <br>
coordBufCoord, // top left src cell in chiBuffer <br>
&srctWriteRect); // dest. screen buffer rectangle <br>
if (! fSuccess) <br>
MyErrorExit("WriteConsoleOutput"); <br>
Sleep(10000); <br>
<br>
// Restore the original active screen buffer. <br>
<br>
if (! SetConsoleActiveScreenBuffer(hStdout)) <br>
MyErrorExit("SetConsoleActiveScreenBuffer"); <br>
<br>
} <br>
</font></html>