Beispiel #1
0
 public static extern bool SetConsoleScreenBufferInfoEx(
     SafeConsoleHandle hConsoleOutput,
     ConsoleScreenBufferInfoEx lpConsoleScreenBufferInfoEx);
Beispiel #2
0
        /// <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;
        }
Beispiel #3
0
        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);
        }