Waiting untill a function ends
hi,
i have a program in which i have to send several mails. so i have a for loop with the function "send". Now i would like to say that the loop has to wait untill the previous send has finished. Can i do this.
In other words is there an opposit function to DoEvents?
Thanx
Re: Waiting untill a function ends
Try the following API's:
private Declare Function OpenProcess Lib "kernel32" (byval dwDesiredAccess as Long, byval bInheritHandle as Long, byval dwProcessId as Long) as Long
private Declare Function WaitForSingleObject Lib "kernel32" (byval hHandle as Long, byval dwMilliseconds as Long) as Long
private Const SYNCHRONIZE = &H100000
private Const INFINITE = &HFFFF
Re: Waiting untill a function ends
Function MyFunc()
Dim myObject As Object
Dim RetVal As Variant
Set myObject = CreateObject("WScript.Shell")
RetVal = myObject.Run("c:\windows\notepad.exe", 1, True)
MsgBox "Notepad is closed"
End Function
'TRue - wait until proc is over
'False don't wait
Iouri Boutchkine
[email protected]