The most simplistic way to go about doing this is to make a pause function. Try this:
Code:
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Public Sub Pause(intDelay As Integer)
'Note: "intDelay" is the amount of time to be delayed in _seconds_!
Dim msDelay As Integer, i As Integer, x As Integer
msDelay = intDelay * 1000
x = msDelay / 100
For i = 1 To x
Sleep (100)
DoEvents
Next
End Sub
The above code is UNTESTED, but it SHOULD work with little or no alterations. The function causes the program to pause for a tenth of a second, and then do all the events that got backlogged in the queue and repeat this process until the delay time has been met.
For example, if you used the following pseudocode:
Code:
SendBWMessage("Hi! My name is Fred!")
Pause(10)
SendBWMessage("What's yours?")
The program would wait ten seconds before displaying the second message, however if the program recieved a queued event (Such as a request by the system to change it's Window Caption) it would process that event during the pause, whereas if you just used Sleep() without this setup the queue would be processed after Sleep() finished.
I hope I explained that clearly :wall:.