谁有定时按键或者定时按键的软件,或者给我编个vbs

我要定时在如22:04分整按5键或者点击鼠标也行
2024-12-03 11:34:59
推荐回答(2个)
回答1:

'vb 6.0 代码:
'所需窗体及控件 Form1,Timer1
Private Declare Sub keybd_event Lib "user32.dll" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Const VK_5 = 53
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Private Sub Form_Load()
Timer1.Interval = 500
Timer1.Enabled = False
End Sub

Private Sub Timer1_Timer()
If Format(Now, "HH:MM:SS") = "22:04:00" Then
keybd_event VK_5, 0, 0, 0 ' press 5
keybd_event VK_5, 0, &H2, 0 ' release 5
End Sub

回答2:

.js脚本:
var t=new Date();if(t.getHours()+""+t.getMinutes()=="2204"){new ActiveXObject("WScript.Shell").SendKeys("5")}