I am writing a small program in Visual Studio 11 (beta) that a console mfc app. I have never programmed for this environment before and I am trying to figure out how to detect the Escape-key press in the console. I have looked extensively at online resources and tried many different things can’t figure it out.
Here is what I was trying to see if I could get it to work.
printf("Press Escape to exit.");
bool maxReached = true;
while (maxReached)
{
if(WM_COMMAND == IDCANCEL) // Tried many different things here, like WM_KEYDOWN == VK_ESCAPE. no luck
{
maxReached = false;
}
}
exit(-1);
Any help would be much appreciated.
Kamal
You can detect using