VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



VB Timer Replacement

by Paul Mather (15 Submissions)
Category: Registry
Compatability: Visual Basic 3.0
Difficulty: Advanced
Date Added: Wed 3rd February 2021
Rating: (40 Votes)

This is an OCX example of the SetTimer and KillTimer API calls. You can essentially replace the VB timer with this example. The Interval property can be set to as long as 24 days. It also has a ProcessPriority property to easily change the priority of your application.
NOTE: Priority level setting DOES NOT WORK on XP or Windows 2000. It won't error out anymore, but the process priority setting code was causing the error. Fixed 12/10/2004

Code Returns
Has the same properties and events as the standard VB Timer.
Side Effects
Please note that the API does not seem to have the necessary resolution to keep accurate time. If you count 60 ticks of 1000 msec interval, you'll find that it actually took longer than that 60000 msec. This can get worse with high processor load. This (as with the standard VB timer) should be used as a re-occurring event trigger rather than a time accurate counter. Please note that wrapping the SetTimer and KillTimer API calls in an OCX is not necessarily desirable. For demonstrative purposes, this is the easiest way. However, in actual implementation, it would be bast to just have the IDBAS_Timer module.

Rate VB Timer Replacement

Upload

Download this snippet    Add to My Saved Code

VB Timer Replacement Comments

No comments have been posted about VB Timer Replacement. Why not be the first to post a comment about VB Timer Replacement.

Post your comment

Subject:
Message:
0/1000 characters