Skip to content

Latest commit

 

History

History
85 lines (63 loc) · 2.75 KB

getlargestconsolewindowsize.md

File metadata and controls

85 lines (63 loc) · 2.75 KB
title description author ms.author ms.topic keywords f1_keywords MS-HAID MSHAttr ms.assetid topic_type api_name api_location api_type
GetLargestConsoleWindowSize function
Retrieves the size of the largest possible console window, based on the current font and the size of the display.
miniksa
miniksa
article
console, character mode applications, command line applications, terminal applications, console api
consoleapi2/GetLargestConsoleWindowSize
wincon/GetLargestConsoleWindowSize
GetLargestConsoleWindowSize
\_win32\_getlargestconsolewindowsize
base.getlargestconsolewindowsize
consoles.getlargestconsolewindowsize
PreferredSiteName:MSDN
PreferredLib:/library/windows/desktop
3e5897f3-4987-4a82-ab19-06c0b231ba67
apiref
GetLargestConsoleWindowSize
Kernel32.dll
API-MS-Win-Core-Console-l2-1-0.dll
KernelBase.dll
API-MS-Win-DownLevel-Kernel32-l1-1-0.dll
DllExport

GetLargestConsoleWindowSize function

[!INCLUDE not-recommended-banner]

Retrieves the size of the largest possible console window, based on the current font and the size of the display.

Syntax

COORD WINAPI GetLargestConsoleWindowSize(
  _In_ HANDLE hConsoleOutput
);

Parameters

hConsoleOutput [in]
A handle to the console screen buffer.

Return value

If the function succeeds, the return value is a COORD structure that specifies the number of character cell columns (X member) and rows (Y member) in the largest possible console window. Otherwise, the members of the structure are zero.

To get extended error information, call GetLastError.

Remarks

The function does not take into consideration the size of the console screen buffer, which means that the window size returned may be larger than the size of the console screen buffer. The GetConsoleScreenBufferInfo function can be used to determine the maximum size of the console window, given the current screen buffer size, the current font, and the display size.

[!INCLUDE no-vt-equiv-user-priv]

Requirements

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

See also

Console Functions

COORD

GetConsoleScreenBufferInfo

SetConsoleWindowInfo

Window and Screen Buffer Size