macinyat,
In the case with the click event, if you are expecting either a msgbox box or a certain other window, you could set up a Do Until Loop to find your next window. If the message box is found, have the sub pause for however many seconds then click the link. If your click results without a msgbox, just have the sub exit. I'm assuming you know how to use the FindWindow and FindWindowEx API functions...
Private Sub Button1_Click()
Dim lngApp as long, lngMsgbox as long, lngOtherWin as long
Do Until lngMsgbox& <> 0 Or lngOtherWin& <> 0
lngApp& = FindWindow(wndClassName,wndCaption)
lngMsgbox& = FindWindowEx(lngApp&, 0&, wndClassName, wndCaption)
lngOtherWin& = FindWindowEx(lngApp&, 0&, wndClassName, wndCaption)
Loop
If lngMsgbox& <> 0 then
Pause 10 'Pauses 10 seconds via the Pause sub provided below
Call PushvbOK 'Make a simple sub that clicks OK
Else
'Do whatever if the other window is found
End if
End Sub
'Heres a little pause sub I used to use quite frequently
Public Sub Pause(Interval)
Dim current 'As Timer
current = Timer
Do While Timer - current < Val(Interval)
DoEvents
Loop
End Sub
I hope this helps a little bit more. It would definately werk better than just having the timer control fire at intervals throughout your program. Just make sure you don't get stuck in that Do Until Loop =)
-núll