现在的位置: 首页 > 综合 > 正文

每5分钟按F5(转)

2013年06月20日 ⁄ 综合 ⁄ 共 376字 ⁄ 字号 评论关闭
dim i as integer
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)'这个是用来检验的
If KeyCode = vbKeyF5 Then Print "hh"
End Sub

Private Sub Form_Load()
Timer1.Interval = 60000'一分钟定时
End Sub
Private Sub Timer1_Timer()
i=i+1
if i=5 then  '五分钟定时
SendKeys "{F5}"
i=0
end if
End Sub 
'这个程序是对Form1也就是自己建立的窗口,执行按F5的
'如果要对其他程序按F5,比方说是计算机,那就在sendkeys上面加这段代码
'ReturnValue = Shell("CALC.EXE", 1) ' 运行计算器。
'AppActivate ReturnValue ' 激活计算器。

抱歉!评论已关闭.