This commit is contained in:
PhoenixARC
2021-08-09 19:05:20 -04:00
parent 6b68cb9b97
commit 10f1c8daa0
320 changed files with 23614 additions and 2195 deletions
@@ -0,0 +1,29 @@
using System;
using System.Runtime.InteropServices;
namespace stonevox
{
public class ConsoleUtil
{
[DllImport("kernel32.dll")]
static extern bool SetConsoleMode(IntPtr hConsoleHandle, int mode);
[DllImport("kernel32.dll")]
static extern bool GetConsoleMode(IntPtr hConsoleHandle, out int mode);
[DllImport("kernel32.dll")]
static extern IntPtr GetStdHandle(int handle);
const int STD_INPUT_HANDLE = -10;
const int ENABLE_QUICK_EDIT_MODE = 0x40 | 0x80;
public static void EnableQuickEditMode()
{
int mode;
IntPtr handle = GetStdHandle(STD_INPUT_HANDLE);
GetConsoleMode(handle, out mode);
mode |= ENABLE_QUICK_EDIT_MODE;
SetConsoleMode(handle, mode);
}
}
}