|
-
Apr 6th, 2008, 11:04 AM
#1
Thread Starter
New Member
VB6 Timer
Hi, I'm currently using a timer to record user scroll and click events with interval being 1 millisecond. It turns out that vb6 timer is not accurate at all. In fact, one second in real life is about 62 units produced by the program. Is there a more accurate way to keep track of time?
Thanks!
-
Apr 6th, 2008, 11:09 AM
#2
PowerPoster
Re: VB6 Timer
 Originally Posted by rqian
Hi, I'm currently using a timer to record user scroll and click events with interval being 1 millisecond. It turns out that vb6 timer is not accurate at all. In fact, one second in real life is about 62 units produced by the program. Is there a more accurate way to keep track of time?
Thanks!
1 milisecond can put you pc very slow.... and don't forget 1000 miliseconds=1second
i hope these information help
-
Apr 6th, 2008, 11:15 AM
#3
Thread Starter
New Member
Re: VB6 Timer
I understand, but I hope to capture mouse scroll and click events in regards to my program.
-
Apr 6th, 2008, 11:32 AM
#4
Re: VB6 Timer
A typical timer (like VB's timer) is about the lowest priority message your app will receive. Mouse events are much higher priority. Timer messages are processed when all other priority messages have been processed. This means when your timer event fires, you may have already missed dozens upon dozens of mouse events. I cannot see anyway you can reliably trap mouse movement events with a timer.
Either use the mouse events in your controls (i.e., MouseMove, MouseDown, MouseUp, etc) or subclass/hook your project and trap the mouse events. Subclassing and hooking are very advanced techniques. Unless someone else provides a suitable alternative, and you decide you want to investigate hooking and are not familiar with it, do some searching on this forum -- you probably will need days, if not weeks, to fully understand it and be able to use without crashing your application.
-
Apr 6th, 2008, 11:48 AM
#5
Re: VB6 Timer
Take a look at this thread.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|