Name
SelectConsoleWindow -- make console window active (V10.0)
Synopsis
SelectConsoleWindow(id)
Platforms
Linux, macOS, Windows

Function
This function makes the console window specified by id the active one. All commands of the console library will then target this console window. The id parameter must be the identifier of a console window allocated by CreateConsoleWindow(). See CreateConsoleWindow for details. The special value -1 can be passed in id to make the default console screen the active window.

Make sure that you do not confuse SelectConsoleWindow() with the similarly named functions SelectBrush(), SelectBGPic(), SelectAnim(), SelectMask(), and SelectAlphaChannel(). All of these functions require you to call EndSelect() when you are done with them, but SelectConsoleWindow() does not have this requirement. In fact, it works in a completely different way so you must never call EndSelect() for SelectConsoleWindow(). If you want to return to the previously active console window, you must call SelectConsoleWindow() again. Calling EndSelect() to restore the previously active console window will definitely not work.

To find out the currently active console window, call the GetConsoleWindow() function. See GetConsoleWindow for details.

You must enable advanced console mode using EnableAdvancedConsole() before you can use this function. See EnableAdvancedConsole for details.

Inputs
id
id of the console window to make active
Example
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.

Show TOC