Topic: MSVC 6: Getting and handling new messages while in a for loop
Okay, first time I have actually asked for help on this project, and I will probably find the answer in a few minutes, but oh well..
I am converting the program Rainbow Crack to use a Windows GUI, and have it mostly working, but there is one problem I am having.
When I am in the for loop that generates all of the hashes, I need it to check to see if there are any new messages. If I don't do this, then a user cannot press any buttons (stop, pause, etc.), and it causes Windows to list the program as unresponsive.
I tried using
if (GetMessage(&Msg, NULL, 0, 0) > 0) {
TranslateMessage(&Msg);
DispatchMessage(&Msg);
}
I tried this, but I assume that TranslateMessage or DispatchMessage is exiting the huge for loop that I need it to stay in, so when I run it, the table file is made, and then it just stops the for loop (the file stays at 0kb).
If you don't know what Rainbow Crack is, just pretend this is a program that is in a huge for loop, and makes a file bigger every second
$theQuestion = (2*b) || !(2*b);