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