Canceling a Timer Event

Note  This topic describes an obsolete function. New applications should use the CreateTimerQueueTimer function to create timers.
 

For every periodic timer creating by calling timeSetEvent, the application must cancel the timer by calling the timeKillEvent function before it frees the memory that contains the callback function. To cancel a timer event, it might call the following function.



void DestroyTimer(NPSEQ npSeq)
{
    if(npSeq->wTimerID) {                // is timer event pending?
        timeKillEvent(npSeq->wTimerID);  // cancel the event
        npSeq->wTimerID = 0;
    }
} 


Related topics

Using Multimedia Timers

 

 

Show: