Have a variable incremented in KeyDown event.
Print out the message "Press any key..."
AforeMentionedVariable = 0;
while (AforeMentionedVariable == 0);
That's not guaranteed to *ever* finish, unless the variable is volatile
- and even if the variable were volatile, you'd still be taking up 100%
CPU until someone pressed a key. Tight loops like that should (almost)
never be used for that kind of thing - it's what Monitor.Wait/Pulse was
designed for.
You're right, my bad. I was just working with textboxes that looked like
consoles and were called consoles (black backgrounds, white characters),
being in fact textboxes. Missed the fact that he asked for Win32 console
app.
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.