Skip to content

Latest commit

 

History

History
82 lines (62 loc) · 2.45 KB

File metadata and controls

82 lines (62 loc) · 2.45 KB
title GetConsoleWindow function
description Retrieves the window handle used by the console associated with the calling process.
author miniksa
ms.author miniksa
ms.topic article
keywords console, character mode applications, command line applications, terminal applications, console api
f1_keywords
consoleapi3/GetConsoleWindow
wincon/GetConsoleWindow
GetConsoleWindow
MS-HAID
\_win32\_getconsolewindow
base.getconsolewindow
consoles.getconsolewindow
MSHAttr
PreferredSiteName:MSDN
PreferredLib:/library/windows/desktop
ms.assetid a5ab0b37-45ac-4413-b6ff-73876556ad38
topic_type
apiref
api_name
GetConsoleWindow
api_location
Kernel32.dll
API-MS-Win-Core-Kernel32-Legacy-l1-1-0.dll
kernel32legacy.dll
API-MS-Win-Core-Kernel32-Legacy-l1-1-1.dll
API-MS-Win-Core-Kernel32-Legacy-l1-1-2.dll
API-MS-Win-DownLevel-Kernel32-l2-1-0.dll
API-MS-Win-Core-Kernel32-Legacy-L1-1-3.dll
API-MS-Win-Core-Kernel32-Legacy-L1-1-4.dll
API-MS-Win-Core-Kernel32-Legacy-L1-1-5.dll
api_type
DllExport

GetConsoleWindow function

[!INCLUDE not-recommended-banner]

Retrieves the window handle used by the console associated with the calling process.

Syntax

HWND WINAPI GetConsoleWindow(void);

Parameters

This function has no parameters.

Return value

The return value is a handle to the window used by the console associated with the calling process or NULL if there is no such associated console.

Remarks

To compile an application that uses this function, define _WIN32_WINNT as 0x0500 or later. For more information, see Using the Windows Headers.

[!INCLUDE no-vt-equiv-local-context]

For an application that is hosted inside a pseudoconsole session, this function returns a window handle for message queue purposes only. The associated window is not displayed locally as the pseudoconsole is serializing all actions to a stream for presentation on another terminal window elsewhere.

Requirements

   
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Header ConsoleApi3.h (via WinCon.h, include Windows.h)
Library Kernel32.lib
DLL Kernel32.dll

See also

Console Functions