Here's a code snippet of how I'm currently trying to get this job done:
Code:
DWORD saveMode;
GetConsoleMode(_scr, &saveMode);
SetConsoleMode(_scr, 0);
if (WaitForSingleObject(_scr, INFINITE) == WAIT_OBJECT_0) {
DWORD num;
ReadConsole(_scr, buf, size, &num, NULL);
}
SetConsoleMode(_scr, saveMode);
WaitForSingleObject() is returning WAIT_FAILED and GetLastError() returns zero! WTF?
Again, I'd really appeciate your shedding the light on what I need to do to accomplish this. Also, if you notice something wrong with this snippet (for example, maybe using the wrong mode for SetConsoleMode()), let me know homie.
Thanks again.