Exemple #1
0
        /// <summary>
        /// Retrieves extended information about the current console font.
        /// </summary>
        /// <param name="hConsoleOutput">
        /// [in] A handle to the console screen buffer. The handle must have the GENERIC_READ access right.
        /// </param>
        /// <param name="bMaximumWindow">
        /// [in] If this parameter is <c>TRUE</c>, font information is retrieved for the maximum window size. If this
        /// parameter is <c>FALSE</c>, font information is retrieved for the current window size.
        /// </param>
        /// <returns>
        /// A <see cref="ConsoleFontInfoEx"/> structure that receives the requested font information.
        /// </returns>
        public static ConsoleFontInfoEx GetCurrentConsoleFontEx(SafeConsoleHandle hConsoleOutput, bool bMaximumWindow)
        {
            var lpConsoleCurrentFontEx = new ConsoleFontInfoEx();
            WinError.ThrowLastWin32ErrorIfFailed(
                GetCurrentConsoleFontEx(hConsoleOutput, bMaximumWindow, lpConsoleCurrentFontEx));

            return lpConsoleCurrentFontEx;
        }
Exemple #2
0
        public void GetCurrentConsoleFontEx()
        {
            SafeConsoleHandle handle = CreateConsoleScreenBuffer(ConsoleAccess.GENERIC_READ);

            var info = new ConsoleFontInfoEx();
            bool result = WinConsole.GetCurrentConsoleFontEx(handle, false, info);
            Trace.WriteLine(TestHelpers.ObjectToString(info));

            Assert.That(result, Is.True);
        }