示例#1
0
 public static extern bool GetConsoleScreenBufferInfo(IntPtr hOut, out ConsoleScreenBufferInfo csbi);
示例#2
0
 public static extern bool GetConsoleScreenBufferInfo(IntPtr hOut, out ConsoleScreenBufferInfo csbi);
示例#3
0
        /// <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;
        }
示例#4
0
 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;
 }
示例#6
0
 public static extern bool GetConsoleScreenBufferInfo(
     IntPtr hConsoleOutput,
     out ConsoleScreenBufferInfo lpConsoleScreenBufferInfo
     );
示例#7
0
 private static extern int GetConsoleScreenBufferInfo(int hConsoleOutput,
                                                      ref ConsoleScreenBufferInfo lpConsoleScreenBufferInfo);
示例#8
0
        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);
        }
示例#9
0
 static extern bool GetConsoleScreenBufferInfo(IntPtr consoleOutput, out ConsoleScreenBufferInfo info);
示例#10
0
 private static extern int GetConsoleScreenBufferInfo(int hConsoleOutput, 
     out ConsoleScreenBufferInfo lpConsoleScreenBufferInfo);