ASV
14 years agoContributor
Waiting VBObject
Hi I write this code 1.Dim t, Timeout 2.t = 0 3. 4. Do While (Not wMDIClient.VBObject("frmPttel").VisibleOnScreen) and t < Timeout 5. BuiltIn.Delay(1000) 6. ...
Dim obj, timeout, t
t = GetTickCount
timeout = ' the waiting time in milliseconds
Set obj = wMDIClient.WaitVBObject("frmPttel", timeout)
If obj.Exists Then
Do While Not obj.VisibleOnScreen
obj.Refresh
If GetTickCount - t > timeout Then
' Do something here like posting an error
Exit Do
End If
Loop
End If
t = GetTickCount - t
Log.Message("Total time: " & t)