FreeConsole

The FreeConsole function detaches the calling process from its console.

BOOL FreeConsole(VOID)
 

Parameters

This function has no parameters.

Return Values

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

If other processes share the console, the console is not destroyed, but the calling process cannot refer to it.

A process can use FreeConsole to detach itself from its current console, and then it can call the AllocConsole function to create a new console.

QuickInfo

  Windows NT: Requires version 3.1 or later.
  Windows: Requires Windows 95 or later.
  Windows CE: Unsupported.
  Header: Declared in wincon.h.
  Import Library: Use kernel32.lib.

See Also

Consoles and Character-Mode Support Overview, Console Functions, AllocConsole