void fix_windows_console_selection()
{
//https://blogs.msdn.microsoft.com/oldnewthing/20130506-00/?p=4453
//Quick edit mode means selecting text will pause the software, which is insane and bad
//auto hConsole = CreateFile(L"CONIN$",GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
auto hConsole = GetStdHandle(STD_INPUT_HANDLE);
DWORD mode;
if (!GetConsoleMode(hConsole, &mode))
{
std::cout << "Failed to get console handle" << std::endl;
}
mode &= ~ENABLE_QUICK_EDIT_MODE;
(see full text)