ConsoleWindow
A class in Root.Township, WindowsConsole.
Opens a native Windows console window for the game process and sends Console output to it. WindowsServerConsole creates one on its console thread.
- Listed in ATT, Features and other game namespaces
- Nested types
CtrlType,HandlerRoutine
Constructors
| Member | What it is |
|---|---|
ConsoleWindow() | Creates a ConsoleWindow with default values. |
Fields
| Member | What it is |
|---|---|
bool IsOpen | True until the console is shut down or closed; the console thread loops while it's true. |
2 private and internal fields
Methods
| Member | What it is |
|---|---|
void Initialize() | Creates the console, registers the close handler and points Console output at it. |
static bool SetConsoleCtrlHandler(ConsoleWindow.HandlerRoutine Handler, bool Add) | Win32 call that registers a handler for Ctrl+C and close events. |
void SetTitle(string strName) | Sets the console window's title. |
void Shutdown() | Restores the old output, frees the console and marks it closed. |
6 private and internal methods
| Member | What it is |
|---|---|
private static bool AllocConsole() | Win32 call that creates a console window for the process. |
private static bool AttachConsole(uint dwProcessId) | Win32 call to attach to another process's console. Not called here. |
private bool ConsoleCtrlCheck(ConsoleWindow.CtrlType ctrlType) | On close, logoff or shutdown of the console, marks it closed and quits the game with an expected shutdown reason. |
private static bool FreeConsole() | Win32 call that detaches the process from its console. |
private static IntPtr GetStdHandle(int nStdHandle) | Win32 call that gets a standard handle (here, standard output). |
private static bool SetConsoleTitle(string lpConsoleTitle) | Win32 call that sets the console's title. |
Used in
Members of other types that take, return or hold a ConsoleWindow: