Code:
SUB StartMMTimer() %TIME_ONESHOT = 0 ' Event occurs once, after uDelay milliseconds %TIME_PERIODIC = 1 ' Event occurs every uDelay milliseconds. %TIME_CALLBACK_FUNCTION = 0 ' When the timer expires, Windows calls the function pointed to by the ' lpTimeProc parameter. This is the default. %TIME_CALLBACK_EVENT_SET = 16 ' When the timer expires, Windows calls theSetEvent function to set the event ' pointed to by the lpTimeProc parameter. The dwUser parameter is ignored. %TIME_CALLBACK_EVENT_PULSE = 32 ' When the timer expires, Windows calls thePulseEvent function to pulse the IF hMMTimer& THEN EXIT SUB hMMTimer = TimeSetEvent ( 1, 1, CODEPTR(MMTimerProc), 0&, %TIME_PERIODIC OR %TIME_CALLBACK_FUNCTION ) END SUB SUB MMTimerProc( BYVAL uID AS LONG, BYVAL uMsg AS LONG, _ BYVAL dwUser AS LONG, BYVAL lp1 AS LONG, BYVAL lp2 AS LONG) ' *** If using a periodic MM timer, you should ensure the code you place in the timer callback function ' *** can finish executing before the next MM timer event. ' do something END SUB ' '
Leave a comment: