[INCLUDE]
DoEventsEx_Sleep

[CODE]
Public Sub DoEventsEx_SleepPeriodical()
  Static xLong1 As Long
  Dim xLong2 As Long
  
  xLong2 = GetTickCount And &H3FFFFFFF
  If xLong2 < xLong1 Then
    If (xLong2 + &H40000000 > xLong1 + DoEventsEx_SleepPeriodical_Interval) Then
      GoTo ProcIt
      End If
    Else
    If (xLong2 > xLong1 + DoEventsEx_SleepPeriodical_Interval) Then
ProcIt:
      DoEventsEx_Sleep SleepValueLow
      xLong1 = GetTickCount And &H3FFFFFFF
      End If
    End If
  End Sub
