ProgrammingAce
03-12-2003, 11:44 PM
What is one way to stop a program that operates in a forever loop? I have a program that does some things (create handles, initalize variables, etc) that then goes into a for-loop. After the for-loop expires, I close the handles and such.
What I want to do is change this for-loop into a forever loop that can be stopped by the user (pushing one of the physical buttons or something like that). I guess polling the software keyboard for a certain keypress at the end of the forever loop would be okay, but I dont know how to do that in this environment. Any possible ideas other than displaying a message box/input box at the end of each cycle? I have been using pure windows API (its a college project and I dont have enough time to learn MFC or something like that).
What I want to do is change this for-loop into a forever loop that can be stopped by the user (pushing one of the physical buttons or something like that). I guess polling the software keyboard for a certain keypress at the end of the forever loop would be okay, but I dont know how to do that in this environment. Any possible ideas other than displaying a message box/input box at the end of each cycle? I have been using pure windows API (its a college project and I dont have enough time to learn MFC or something like that).