Does someone knows how can I make a big ass loop be in sync with an application main message loop ?
My objective is to allow the 'big ass loop' work while checking if the user is moving the window, clicking some button, etc...
The problem I'm having is that if I just call the 'big ass loop' it will go so fast (or slow) that it will not allow the window / application messages to be verified at the correct moment, finally making the window / dialog freeze while the loop finishes.
I managed to find a way to make the loop more flexible with the window using this inside the loop...
UpdateWindow();
but if I click something or at least move another window in front of the working window it will cause a repaint message to be sent and boom the window will freeze while the loops end. If I click somewhere on the window while the loop is going on the window will freeze as well until the loop finishes >___>
If someone know how to make a loop more flexible with window messages I will appreciate the help a lot
I will keep doing my research anyway and if I find a solution and by that time nobody has posted any solution, I will share it so others can learn too ^^.
PS: btw, I think the solution could be making the window an alternate thread so the loop runs separated from it and that way I could probably still be able to send information from inside the loop to the window, like for example update static text controls, etc.
SeeYaa!