Click to Rate and Give Feedback
MSDN
MSDN Library
System Services
Console Reference
Console Functions
 GetLargestConsoleWindowSize Functio...
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: 10/8/2009

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
vb.net syntax      dmex   |   Edit   |   Show History
<DllImport("kernel32.dll", SetLastError:=True)> _
Public Shared Function GetLargestConsoleWindowSize(ByVal hConsoleOutput As IntPtr) As COORD End Function

Flag as ContentBug
C# syntax      dmex   |   Edit   |   Show History
[DllImport("kernel32.dll", SetLastError=true)]
internal static extern COORD GetLargestConsoleWindowSize(IntPtr hConsoleOutput);
Tags What's this?: c# (x) syntax (x) Add a tag
Flag as ContentBug
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Site Feedback
Page view tracker