public static extern bool GetConsoleScreenBufferInfo(IntPtr hOut, out ConsoleScreenBufferInfo csbi);
/// <summary> /// Retrieves information about the specified console screen buffer. /// </summary> /// <param name="hConsoleOutput"> /// [in] A handle to the console screen buffer. The handle must have the <see cref="ConsoleAccess.GENERIC_READ"/> /// access right. /// </param> /// <returns> /// A <see cref="ConsoleScreenBufferInfo"/> structure that receives the console screen buffer information. /// </returns> public static ConsoleScreenBufferInfo GetConsoleScreenBufferInfo(SafeConsoleHandle hConsoleOutput) { var lpConsoleScreenBufferInfo = new ConsoleScreenBufferInfo(); WinError.ThrowLastWin32ErrorIfFailed( GetConsoleScreenBufferInfo(hConsoleOutput, lpConsoleScreenBufferInfo)); return lpConsoleScreenBufferInfo; }
private static extern Boolean GetConsoleScreenBufferInfo( IntPtr hConsoleOutput, out ConsoleScreenBufferInfo lpConsoleScreenBufferInfo);
private ConsoleScreenBufferInfo GetScreenBufferInfo() { if (disposed) { throw new ObjectDisposedException(this.ToString()); } ConsoleScreenBufferInfo csbi = new ConsoleScreenBufferInfo(); if (!WinCon.GetConsoleScreenBufferInfo(_handle, csbi)) { int err = Marshal.GetLastWin32Error(); Console.WriteLine("err = {0}", err); throw new IOException("Error getting screen buffer info", err); } return csbi; }
public static extern bool GetConsoleScreenBufferInfo( IntPtr hConsoleOutput, out ConsoleScreenBufferInfo lpConsoleScreenBufferInfo );
private static extern int GetConsoleScreenBufferInfo(int hConsoleOutput, ref ConsoleScreenBufferInfo lpConsoleScreenBufferInfo);
public void GetConsoleScreenBufferInfo() { SafeConsoleHandle handle = CreateConsoleScreenBuffer(ConsoleAccess.GENERIC_READ); var info = new ConsoleScreenBufferInfo(); bool result = WinConsole.GetConsoleScreenBufferInfo(handle, info); Trace.WriteLine(TestHelpers.ObjectToString(info)); Assert.That(result, Is.True); }
static extern bool GetConsoleScreenBufferInfo(IntPtr consoleOutput, out ConsoleScreenBufferInfo info);
private static extern int GetConsoleScreenBufferInfo(int hConsoleOutput, out ConsoleScreenBufferInfo lpConsoleScreenBufferInfo);