Paste this code in a form:
Code:
Option Explicit
Private Declare Function SetTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long
Private Declare Function KillTimer Lib "user32" (ByVal hwnd As Long, ByVal nIDEvent As Long) As Long
Public Sub StartBuggin(Ownerhwnd As Long, IntervalMilliSec As Long)
SetTimer Ownerhwnd, 0, IntervalMilliSec, AddressOf TimerProc
End Sub
Public Sub StopBuggin(Ownerhwnd As Long)
KillTimer Ownerhwnd, 0
End Sub
Private Sub Form_Load()
StartBuggin Me.hwnd, 1000 ' 1000 milliseconds = 1 second...
End Sub
Private Sub Form_Unload(Cancel As Integer)
StopBuggin Me.hwnd
End Sub
and this code in a module:
Code:
Public Sub TimerProc()
MsgBox "Hi... I'm just annoying you...", vbCritical, "Tadaaaa"
End Sub
Enjoy!