Iβm afraid that you misunderstood how system timers work and how to use them - the thing is that they automatically start in the background, so you donβt need to do your own thread control.
There are examples and explanations of Windows timers in general, and you can use them if you are trying to flip your own Timer : Timers Tutorial class
This is the Timer class that ships with Windows.NET, with sample code below: Timer Class
Edited to add:
Here is an example Win32 timer example (from the page from the tour.), Adapted for an application other than MFC:
int nTimerID; void Begin(HWND hWindow_who_gets_the_tick) {
See MSDN: timer functions for more information.
Then, inside your window procedure, you will receive a WM_TIMER message and reply as you like.
Alternatively, a timer may invoke a user procedure. See the SetTimer function for more details .
source share