Hi all .I got command8 function that clicks a button(command1) every pre defined seconds (for example every Text16.Text=30 seconds)by the user.
I wonder how i can change timer4 interval inside timer3 when for example application form failed messagebox pops up ? I want some how inside timer3 make the time4 internal to 1 or 1.5 or 2 mins and after 2 min passed change the timer4 interval back to original value(orginal value 30 seconds)! (so my goal is after i get application failed meessagbox pops up i take 1.5 or 2 min timeout and then start clicking the button every 30 seconds again..).For example if 15 second is left so command1 get clicked and at this moment i get that failed popup box so i want the command1 get clicked after 1 or 1.5 or 2 min not after 15 seconds!
could any one show me how i can achieve that.Thanks
Code:Private Sub Command8_Click() If Command8.Caption = "Start" Then Command8.Caption = "Reset" Timer4.Interval = Val(Text16.Text * 1000) Timer4.Enabled = True Else: Timer4.Enabled = False Command8.Caption = "Start" Text16.SetFocus ClickCount = 0 End If End Sub Private Sub Timer4_Timer() ClickCount = ClickCount + 1 MaxClicks = Text17 Command1.Value = True ' command1 button is get click after this many seconds Command1.Caption = "Clicked" If ClickCount = MaxClicks Then Timer4.Enabled = False MsgBox "Maximum Clicks Reached" ClickCount = 0 Command8.Caption = "Start" End If End Sub Private Sub Timer3_Timer() Dim X As Long, editx As Long Dim button As Long X = FindWindow("#32770", "Application form has failed") If Not X = 0 Then 'Now i need to rest timer4 internet to 2 min Timer3.Enabled = False ' window was found so stop timer End If End Sub




Reply With Quote