
This example shows a !completely! formless Timer alternative that only uses 2 API calls (SetTimer & KillTimer). This example also addresses some secuirity issues presented by the SetTimers CallBacks. I also defined all the exposed property descriptions for easy inclusion into your projects.
Inputs
Interval Property as a Long value representing Milliseconds.
Enabled Property used to Start or stop the Timer (Not to faroff from the VB Timer Control)
Assumes
The API is finiky, I crashed the VB IDE 3 times developing this tidbit until I got it stable. If you want to modify the code save often or the API will bite you.
Returns
Returns a 'Timer' Event
Side Effects
Some security issues that you will see in the code/comments
API DeclarationsPrivate 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