Hi Everybody,
I am writing a bit of code to play with timers. I create the timer OK and can run code under the WM_TIMER event, but I cannot stop the timer. I would like my code to be able to start and stop the timer, so my program has a 'Off' button that kills the timer. I call the KillTimer call but the timer won't stop! It just keeps on going. Can anyone advise on how I should be using timers?
Regards,
Lightman
If KillTimer is not stopping the timer then the likely cause is that one of the parameters is wrong. If you specified a window handle and a timer id in the call to SetTimer, then you must pass the same handle and the same id to KillTimer. If you did not specify a window handle in the call to SetTimer, then the system assigns the timer id, and you must pass the id that SetTimer returned to KillTimer.
Cheers for that, I got it working now.
I found it a little confusing. It seems some of the parameters are optional depending on how the timer is created.
Regards,
Lightman