If I have some code that is executing that takes a while to complete is there any way to process messages at the same time??
i.e. if I have some code like this (below), where the program is stuck in a loop for 100000 milliseconds, is there anyway to process say a mouseclick while it is running?
-------------------------------
timeInterval = 100000
lastCount = GetTickCount;
do{
Count = GetTickCount;
} while(Count < (LastCount+timInterval))
-------------------------------
Alternatively, is there any way to switch off certain inputs while code is running. e.g. if a user was to click a mouse button while the above code was running the mouse click message would be ignored completely so that it doesn't get processed even after the code has completed.
This may sound the opposite, but my problem is that I have some code similar to the above and I want to disable mouse clicking whilst it is running. I tried using conditions to test if the code was running or not in the mouse click message handler but by the time the message was processed these conditions would always show that it wasn't (because the mouse click message obviously wouldnt be processed till the code was finished).
So I thought that the solution would either be to process the mouse click instantly (and test to see if the code is running), or to disable mouse clicking messages whilst the code was running.
Hope this makes sense! (?)
thanks in advance
dt