GetLargestConsoleWindowSize Function

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

Syntax

C++
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 rows (X member) and columns (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.

Requirements

Minimum supported clientWindows 2000 Professional
Minimum supported serverWindows 2000 Server
HeaderWincon.h (include Windows.h)
LibraryKernel32.lib
DLLKernel32.dll

See Also

Console Functions
COORD
GetConsoleScreenBufferInfo
SetConsoleWindowInfo
Window and Screen Buffer Size

Send comments about this topic to Microsoft

Build date: 11/19/2009

Tags :


Community Content

dmex
vb.net syntax
<DllImport("kernel32.dll", SetLastError:=True)> _
Public Shared Function GetLargestConsoleWindowSize(ByVal hConsoleOutput As IntPtr) As COORD End Function

Tags : vb.net syntax

dmex
C# syntax
[DllImport("kernel32.dll", SetLastError=true)]
internal static extern COORD GetLargestConsoleWindowSize(IntPtr hConsoleOutput);
Tags : c# syntax

Page view tracker