[API]
COORD
SMALL_RECT
CONSOLE_SCREEN_BUFFER_INFO
GetStdHandle
GetConsoleScreenBufferInfo
FillConsoleOutputCharacterA
FillConsoleOutputCharacterW
FillConsoleOutputAttribute
SetConsoleCursorPosition

[CODE]
Public Sub ClearConsoleOutput()
  Dim xLong1 As Long
  Dim xLong2 As Long
  Dim xType1 As CONSOLE_SCREEN_BUFFER_INFO
  
  xLong1 = GetStdHandle(-11&)
  If Not xLong1 = -1& Then
    If Not GetConsoleScreenBufferInfo(xLong1, xType1) = 0& Then
      If IsUnicode Then
        Call FillConsoleOutputCharacterW(xLong1, 32&, xType1.dwSize.x * xType1.dwSize.y, 0&, xLong2)
        Else
        Call FillConsoleOutputCharacterA(xLong1, 32&, xType1.dwSize.x * xType1.dwSize.y, 0&, xLong2)
        End If
      Call FillConsoleOutputAttribute(xLong1, xType1.wAttributes, xType1.dwSize.x * xType1.dwSize.y, 0&, xLong2)
      Call SetConsoleCursorPosition(xLong1, 0&)
      End If
    End If
  End Sub
