Public StartTime As Long, EndTime As Long, I As Long
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Sub Command1_Click()
Dim ReturnValue, I
ReturnValue = Shell("c:\windows\system32\notepad.exe", 1)
AppActivate ReturnValue
StartTime = 1
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Form_Load()
Command1.Caption = "start"
Command2.Caption = "end"
Timer1.Interval = 1000
End Sub
Private Sub Timer1_Timer()
If StartTime = 1 Then
SendKeys "{TAB}"
Call Sleep(1000)
SendKeys "1"
Call Sleep(1000)
End If
End Sub