We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

Keystroke Counter

tabolt
tabolt asked
on
Medium Priority
1,196 Views
Last Modified: 2012-08-13
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
Comment
Watch Question

Mike TomlinsonHigh School Computer Science, Computer Applications, Digital Design, and Mathematics Teacher
CERTIFIED EXPERT
Top Expert 2009

Commented:
What language are you working in tabolt?...

(You won't be able to do this in VBScript!)

Author

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, Digital Design, and Mathematics Teacher
CERTIFIED EXPERT
Top Expert 2009

Commented:
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...

Author

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!

Commented:
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.
High School Computer Science, Computer Applications, Digital Design, and Mathematics Teacher
CERTIFIED EXPERT
Top Expert 2009
Commented:
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.


Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Commented:
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, Digital Design, and Mathematics Teacher
CERTIFIED EXPERT
Top Expert 2009

Commented:
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.

Author

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, Digital Design, and Mathematics Teacher
CERTIFIED EXPERT
Top Expert 2009

Commented:
Take a look at the two links in my previous comments...  =)

Author

Commented:
Sorry....I noticed that only after sending my last note. Thanks!
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.