VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Anouther Formless Timer

Dane Jones  (2 Submissions)   Libraries   Visual Basic 3.0   Intermediate   Wed 3rd February 2021

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 Declarations
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

Rate Anouther Formless Timer (14(14 Vote))

Download Anouther Formless Timer

Anouther Formless Timer Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters