Public Declare Function SetTimer Lib "user32" (ByVal hWnd As Long, _
ByVal nIDEvent As Long, ByVal uElaspe As Long, ByVal lpTimerFunc As Long) As Long
Public Declare Function KillTimer Lib "user32" (ByVal hWnd As Long, ByVal nIDEvent As Long) As Long
Public PopTime As Long
Sub Test()
Dim x
PopTime = SetTimer(0, 0, 5000, AddressOf CloseInputBox)
x = Application.InputBox("請輸入")
If x = "" Then x = "n"
MsgBox x
KillTimer 0, PopTime
End Sub
Sub CloseInputBox(ByVal hWnd As Long, ByVal uMsg As Long, ByVal idevent As Long, ByVal Systime As Long)
Application.SendKeys "~", True
KillTimer 0, PopTime
End Sub
網路找到的,試試~~作者: t8899 時間: 2015-10-24 19:21
Public Declare Function SetTimer Lib "user32" (ByVal hWnd As Long, _
ByVal nIDEvent As Long, By ...
准提部林 發表於 2015-10-24 12:03