public static extern bool SetConsoleScreenBufferInfoEx( SafeConsoleHandle hConsoleOutput, ConsoleScreenBufferInfoEx lpConsoleScreenBufferInfoEx);
/// <summary> /// Retrieves extended 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="ConsoleScreenBufferInfoEx"/> structure that receives the requested console screen buffer /// information. /// </returns> public static ConsoleScreenBufferInfoEx GetConsoleScreenBufferInfoEx(SafeConsoleHandle hConsoleOutput) { var lpConsoleScreenBufferInfoEx = new ConsoleScreenBufferInfoEx(); WinError.ThrowLastWin32ErrorIfFailed( GetConsoleScreenBufferInfoEx(hConsoleOutput, lpConsoleScreenBufferInfoEx)); return lpConsoleScreenBufferInfoEx; }
public void GetConsoleScreenBufferInfoEx() { SafeConsoleHandle handle = CreateConsoleScreenBuffer(ConsoleAccess.GENERIC_READ); var info = new ConsoleScreenBufferInfoEx(); bool result = WinConsole.GetConsoleScreenBufferInfoEx(handle, info); Trace.WriteLine(TestHelpers.ObjectToString(info)); Assert.That(result, Is.True); }