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