如何实现用VB每1秒模拟键盘按下Ctrl

来源:百度知道 编辑:UC知道 时间:2024/06/23 00:42:36
如何实现用VB每1秒模拟键盘按下Ctrl??

Private Sub Form_Load()
Timer1.Interval = 1000
Timer1.Enabled = True
End Sub

Private Sub Timer1_Timer()
SendKeys "{^}"
End Sub

Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long) '想延时一秒就写: Sleep(1000)

Private Sub Command1_Click()
Sleep (1000)
SendKeys "{^}" '这里你自己循环了
End Sub