Code: Select all
#include once "windows.bi"
Sub SetWindow( WinLeft As Short, WinTop As Short, WinRight As Short, WinBottom As Short )
Dim As HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE)
SetConsoleScreenBufferSize(hOut, Type <COORD>(100, 60)) ' Default buffer size
SetConsoleWindowInfo(hOut, True, Type <SMALL_RECT>(WinLeft, WinTop, WinRight, WinBottom))
End Sub
Sleep
SetConsoleWindowInfo is typically inconsistent as it doesn't use a structure name but a pointer to a structure, so I ended up with a type mismatch when I used Type <SMALL_RECT>'.
Needless to say, I have tried umpteen ways to develop a shorthand way to avoid that.
Does a shorthand method exist when using a structure pointer, or am I forced to use the longhand way?