You can cancel an active timer event at any time. Be sure to cancel any out-standing timers before freeing the DLL containing the callback function. To cancel a timer event, use the timeKillEvent function, which has the following syntax:
WORD timeKillEvent(wId)
Pass the timer ID returned by timeSetEvent to the wId parameter.