C++ Timer Class
Categories: C, Source Code, Windows
Tags:
Starting from the article “C++ timer”, we created a simply class that act as a wrapper to the Windows API and that easily allows to start a timer, stop it. and assign the function to call when the timer is elapsed.

The following is a little example that explains how to use the class:
// this is the method invoked when the timer is elapsed
void CALLBACK OnTimer(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
{
// write here the code to execute at onTimer event
}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int nCmdShow)
{
// ...
Timer * timer = new Timer(NULL, (TIMERPROC)OnTimer, 1, 1000);
timer->StartTimer();
// ..
}
The class is very simple and is based on the post “C++ timer”, so I avoid explanations about the code and I leave you with the download.
Download C++ Timer Class. Downloads: 1338
Se sei interessato a questo post, potresti anche provare a leggere:
- No related posts
08 Jun 2007 dzamir
Very Thx, this is a great class, it helped me a lot
UsandoInternal Server Error
Usandohi
i couldn’t download it
could you help me?
I LOVE CUMMING
Usando/
8===D ~ ~ O:
…………………I LOVE CUMMING
Usando………………../
8===D ~ ~ O:
how can a buy that timer?
UsandoBustin a nut is great
Usando