예제 #1
0
        /// <summary>
        /// Retrieves information about the current console selection.
        /// </summary>
        /// <returns>
        /// A <see cref="ConsoleSelectionInfo"/> structure that receives the selection information.
        /// </returns>
        public static ConsoleSelectionInfo GetConsoleSelectionInfo()
        {
            var lpConsoleSelectionInfo = new ConsoleSelectionInfo();
            WinError.ThrowLastWin32ErrorIfFailed(GetConsoleSelectionInfo(lpConsoleSelectionInfo));

            return lpConsoleSelectionInfo;
        }
예제 #2
0
        public void GetConsoleSelectionInfo()
        {
            WinConsole.AllocConsole();

            var info = new ConsoleSelectionInfo();
            bool result = WinConsole.GetConsoleSelectionInfo(info);
            Trace.WriteLine(TestHelpers.ObjectToString(info));

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