For Win32 try this. I am not sure how it ports
to Win 16-bit platform.
Best Regards,
abp
#include <windows.h>
#include <conio.h>
#define SPACE ' '
int clear_console();
main()
{
clear_console();
return;
}
int clear_console()
{
// Get the handle to Standard Output (STDOUT)
HANDLE hndlStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_SCREEN_BUFFER_INFO csBi;
// Fill console screen buffer
GetConsoleScreenBufferInfo(hndlStdOut, &csBi);
DWORD written;
DWORD SZ;
SZ = csBi.dwSize.X * csBi.dwCursorPosition.Y;
// csBi.dwCursorPosition.X + 1;
COORD curhome = {0, 0};
FillConsoleOutputCharacter(hndlStdOut, SPACE, SZ, curhome, &written);
csBi.srWindow.Bottom -= csBi.srWindow.Top;
csBi.srWindow.Top = 0;
SetConsoleWindowInfo(hndlStdOut, TRUE, &csBi.srWindow);
SetConsoleCursorPosition(hndlStdOut, curhome);
return 0;
}