
Originally Posted by
LaVolpe
I doubt it. That API basically tests the message queue. Without breaking up your loop with a DoEvents, no other code will be allowed to run while your code is looping. In order to allow other instances of your control to enter their own loops & run their own code, DoEvents (or something similar) is probably the answer. Any code that is executing has nothing to do directly with the message queue. Of course a message may be processed by the queue that activates code (timer for example) or your code may insert messages into the queue (PostMessage for example).
stills working 1 timer at a time
Code:
Private Sub WaitMs(ByVal lngMS As Long) 'wait a given number of milliseconds
Dim t As Currency
Dim f As Currency
Dim e As Currency
Do
f = 0
t = 0
e = 0
QueryPerformanceFrequency f 'get number of counts/second
t = f * lngMS / 1000# 'multiply f by number of seconds to get number of counts to wait
QueryPerformanceCounter e 'get current count number
e = e + t 'add number of counts to wait to current count
Do
QueryPerformanceCounter t
If t > e Then
RaiseEvent Timer
If blnEnabled = False Then
Exit Sub
End If
Exit Do
End If
DoEvents
Loop
If blnEnabled = False Then
Exit Do
End If
Loop
End Sub
instead use the do_events can i use 1 api function for tell the program for work with next "work"\process\event?