mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/PCK-Studio.git
synced 2026-06-02 20:04:32 +00:00
29 lines
823 B
C#
29 lines
823 B
C#
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);
|
|
}
|
|
}
|
|
} |