- 积分
- 23137
- 明经币
- 个
- 注册时间
- 2008-11-22
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2015-8-13 12:05:14
|
显示全部楼层
Public Declare PtrSafe Function SetTimer Lib "user32.dll" (ByVal hwnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Longptr) As Long
Public Declare PtrSafe Function KillTimer Lib "user32.dll" (ByVal hwnd As Long, ByVal nIDEvent As Long) As Long
Public lTimerID As Integer
Public Sub Start_Timer()
If lTimerID = 0 Then
lTimerID = SetTimer(0&, 0&, 3000, AddressOf Ontime)
Else
Call Stop_Timer
lTimerID = SetTimer(0&, 0&, 3000, AddressOf Ontime)
End If
End Sub
Public Sub Stop_Timer()
KillTimer 0&, lTimerID
End Sub
Public Sub Ontime()
Dim R As Integer
R = MsgBox("ok", vbOKCancel)
If R = vbCancel And lTimerID <> 0 Then Call Stop_Timer
End Sub
Private Sub aaa()
Call Start_Timer
End Sub |
|