Keystroke Counter

Hello Again Everyone!
I need to count keystrokes and mouse clicks on several pcs and log them to a file on a remote machine. There is no concern whatsoever as to what they are typing or clicking, simply a total count of keystrokes and mouse clicks on a per 10 minute basis. Any suggestions???? Thanks! Tim
taboltAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mike TomlinsonHigh School Computer Science, Computer Applications, and Mathematics TeachersCommented:
What language are you working in tabolt?...

(You won't be able to do this in VBScript!)
taboltAuthor Commented:
I am open to most any suggestion if someone is willing to help guide me. Is there a way to do it in one language that is better than others?
Mike TomlinsonHigh School Computer Science, Computer Applications, and Mathematics TeachersCommented:
Well, what tools do you have available to you?

I can give you code in VB6, VB.Net 2003 or VB.Net 2005 Express.

This could also be in done in C#, C++, Delphi and many other languages I'm sure...
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

taboltAuthor Commented:
Idle, Thanks for your assist. I'm currently running VS2005 on my box. Whatever is easiest and most convenient for you, I'll make it work. Thanks Again!
steveiamCommented:
The code here could serve as a good starting point: http://www.codeproject.com/dll/keyboardhook.asp

The 'catch' with global keyboard hooks is that the routine has to be in a DLL, so you have to:
 - make a DLL with the hook routine
 - make a main application that loads the DLL, and starts it off.
Mike TomlinsonHigh School Computer Science, Computer Applications, and Mathematics TeachersCommented:
That's not entirely true steveiam.

You CAN hook the keyboard and mouse WITHOUT using a DLL in VB6 or VB.Net by using WH_KEYBOARD_LL and WH_MOUSE_LL:
http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/VB_DOT_NET/Q_21596242.html
http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/VB_DOT_NET/Q_21731363.html

For VB.Net 2005, the low level hooks only work when you run the RELEASE version of the app.  They won't work in the debug versions in the IDE for some reason.  They work fine in the IDE under VB.Net 2003 though.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
steveiamCommented:
Ah.. Ok.. Its been a while since I did it, and it was in C++.  My apologies for the misinformation.
Mike TomlinsonHigh School Computer Science, Computer Applications, and Mathematics TeachersCommented:
The "LL" (low level) hooks are the only two you can do like this in VB6/VB.Net.  All other hooks must be accomplished via an external DLL as you describe.
taboltAuthor Commented:
Thanks for the input everyone! Idle, were you going to post sample code as I've never experiemented with these before? Thanks!
Mike TomlinsonHigh School Computer Science, Computer Applications, and Mathematics TeachersCommented:
Take a look at the two links in my previous comments...  =)
taboltAuthor Commented:
Sorry....I noticed that only after sending my last note. Thanks!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.