I am trying to disable quick edit mode in the console with winapi. The documentation says:
To enable this mode, use ENABLE_QUICK_EDIT_MODE | ENABLE_EXTENDED_FLAGS. To disable this mode, use ENABLE_EXTENDED_FLAGS without this flag.
I expected this code to work:
#include <Windows.h>
#include <iostream>
int main() {
HANDLE console = CreateConsoleScreenBuffer(GENERIC_READ | GENERIC_WRITE, 0, NULL, CONSOLE_TEXTMODE_BUFFER, NULL);
SetConsoleActiveScreenBuffer(console);
if (!SetConsoleMode(console, ENABLE_EXTENDED_FLAGS))
std::cout << GetLastError() << std::endl;
for (;;);
return 0;
}
But I can still select in the console and it prints 87
which is ERROR_INVALID_PARAMETER
.
I also tried this answer but I got the same results.
I am using clang version 10.0.0