in a WIN32API program how would you count down from a certain number of seconds without delaying messages by using "sleep(int time)"
in a WIN32API program how would you count down from a certain number of seconds without delaying messages by using "sleep(int time)"
In a perfect world every dog would have a home and every home would have a dog.
Visit My Web Site, Canine Programming
I use Win32 API
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...
Code:#include <cmath> #include <complex> bool euler_flip(bool value) { return std::pow ( std::complex<float>(std::exp(1.0)), std::complex<float>(0, 1) * std::complex<float>(std::atan(1.0) *(1 << (value + 2))) ).real() < 0; }
Watch the accuracy of timer msg's as they have the lowest priority in the cue.
"Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
Friedrich Nietzsche
"I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
George Best
"If you are going through hell....keep going."
Winston Churchill