[id] = CreateConsoleWindow(id, cols, rows, x, y[, parent, rel])
x and y. To
create a new full-screen window, just set cols, rows, x and y all to 0. The
new window will be given the identifier specified in id. If you pass Nil
in id, CreateConsoleWindow() will automatically choose an identifier and return
it.
If you set the parent argument to the identifier of an existing console window,
the specified window will be set as the parent of the new console window so that
the new console window will become a subwindow. You can pass -1 in parent to set
the default console window as the parent. If you set rel to True, the x and y
coordinates will be interpreted as relative to the parent window's origin instead
of relative to the screen's origin.
Once you have created the console window, you can then use SelectConsoleWindow() to make it the active console window. See SelectConsoleWindow for details.
Note that a console window is not the same as a window on your desktop. A console window merely is a certain area in the console that is regarded as an own window. This makes it easier to create textual user interfaces because you can divide your console screen into several windows and then all drawing is automatically clipped at the window edges.
You must enable advanced console mode using EnableAdvancedConsole() before you can use this function. See EnableAdvancedConsole for details.
x and y specify relative offsets (defaults to False)EnableAdvancedConsole() w, h = GetConsoleSize() CreateConsoleWindow(1, 20, 20, (w - 20) / 2, (h - 20) / 2) SelectConsoleWindow(1) DrawConsoleBorder() RefreshConsole()The code above creates a new 20x20 window, draws a border around it and centers it on the screen.