Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums
Views: 2377 | Replies: 9
![]() |
•
•
Join Date: May 2006
Posts: 6
Reputation:
Rep Power: 0
Solved Threads:
0
Hey, I need to write program, which will do some action after 11 minutes.
I have that action done, but I dont know how to write to wait 11 minutes, and how to write to wait 20 secs after 1 action.
It need to wait 20 secs after Call SendKeys("{ENTER}", True) and it need to wait 11 minutes after F5 then it need to do the same action (TAB > 20 secs, ENTER). Thanks
I have that action done, but I dont know how to write to wait 11 minutes, and how to write to wait 20 secs after 1 action.
Private Sub Command1_Click()
Dim hWnd As Long
hWnd = FindWindowByCaption("welcome to mia's website - Mozilla Firefox")
If hWnd = 0 Then
MsgBox "Window not found", vbCritical, "Fehler"
Else
Call BringWindowToTop(hWnd):
Call SendKeys("TAB", True)
Call SendKeys("{ENTER}", True)
Call SendKeys("{F5}", True)
End If
End SubIt need to wait 20 secs after Call SendKeys("{ENTER}", True) and it need to wait 11 minutes after F5 then it need to do the same action (TAB > 20 secs, ENTER). Thanks
•
•
Join Date: Apr 2005
Location: West Yorkshire, England
Posts: 72
Reputation:
Rep Power: 4
Solved Threads:
6
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) Public Sub Wait(Seconds As Single) Dim lMilliSeconds As Long lMilliSeconds = Seconds * 1000 Sleep lMilliSeconds End Sub
wait 660
this will wait for 11 minutes.
•
•
Join Date: Apr 2005
Location: West Yorkshire, England
Posts: 72
Reputation:
Rep Power: 4
Solved Threads:
6
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub Command1_Click()
Dim hWnd As Long
hWnd = FindWindowByCaption("welcome to mia's website - Mozilla Firefox")
If hWnd = 0 Then
MsgBox "Window not found", vbCritical, "Fehler"
Else
Call BringWindowToTop(hWnd):
Call SendKeys("TAB", True)
Call SendKeys("{ENTER}", True)
Wait 20
Call SendKeys("{F5}", True)
Wait 660
End If
End Sub
Public Sub Wait(Seconds As Single)
Dim lMilliSeconds As Long
lMilliSeconds = Seconds * 1000
Sleep lMilliSeconds
End SubNot sure what you mean about looping?
Do you want to repeat
Call SendKeys("TAB", True)
Call SendKeys("{ENTER}", True)
Wait 20
Call SendKeys("{F5}", True)
Wait 660A set number of times?
If so you could wrap it in a for..Next loop
pG
•
•
Join Date: May 2006
Posts: 6
Reputation:
Rep Power: 0
Solved Threads:
0
sipmly, I want to repeat
Call SendKeys("TAB", True)
Call SendKeys("{ENTER}", True)
Wait 20
Call SendKeys("{F5}", True)
Wait 660•
•
Join Date: Apr 2005
Location: West Yorkshire, England
Posts: 72
Reputation:
Rep Power: 4
Solved Threads:
6
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub Command1_Click()
Dim hWnd As Long
Dim iCounter as Integer
hWnd = FindWindowByCaption("welcome to mia's website - Mozilla Firefox")
If hWnd = 0 Then
MsgBox "Window not found", vbCritical, "Fehler"
Else
For iCounter = 1 to 1000
Call BringWindowToTop(hWnd):
Call SendKeys("TAB", True)
Call SendKeys("{ENTER}", True)
Wait 20
Call SendKeys("{F5}", True)
Wait 660
Next iCounter
End If
End SubThis will repeat 1000 times.
pG
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)






Linear Mode