in a WIN32API program how would you count down from a certain number of seconds without delaying messages by using "sleep(int time)"
Printable View
in a WIN32API program how would you count down from a certain number of seconds without delaying messages by using "sleep(int time)"
Create a timer with SetTimer(HWND hwnd, int ID, int milliCycle);
(I might have the last two params backwords)
Anyway, set the milliSec duration to 1000, since that's a second...
And be sure to kill the timer when your done with KillTimer(HWND hwnd, int ID);
Oh yeah, do all you work in the case WM_TIMER switch...
Watch the accuracy of timer msg's as they have the lowest priority in the cue.