?
Solved

Monitoring KeyStrokes

Posted on 2002-05-29
12
Medium Priority
?
233 Views
Last Modified: 2010-05-02
We need to write an application that monitors every single key stroke made on a computer, but have the monitoring application sitting in the background, completely invisible to the user.  Is there an API available that can help do this?  If so, how do we use it?

Ta.
0
Comment
Question by:Luke_Stephens
  • 4
  • 4
  • 3
  • +1
12 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 600 total points
ID: 7041388
You are after a Keylogger in effect. There are many commercially available applications that do this, also many freeware/shareware ones as well. The basic problem in creating such an application is that you cannot easily create a systemwide hook into the keyboard buffer. You have to have the callback process in a standard dll which cannot be created by VB. However there are a number of standard dlls created for this very purpose. One that I have used succesfully is from http://www.vbaccelerator.com the vbalhook.dll. There are also samples here that can be used to build exactly the sort of application you are interested in.
0
 
LVL 2

Expert Comment

by:corvanderlinden
ID: 7041494
You cna use Hooks

The WH_KEYBOARD and WH_KEYBOARD_LL intercept messages that relate to keyboard input.

The WH_JOURNALRECORD Hook receives mouse, keyboard and other hardware messages from the system.
0
 
LVL 43

Expert Comment

by:TimCottee
ID: 7041522
Indeed corvanderlinden you can but you still need to use an additional dll to make this systemwide as vb can only handle application wide hooks.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 28

Expert Comment

by:AzraSound
ID: 7041789
"Subclass Keyboard and Mouse Events in Other Applications (Version 2.0)"
http://www.freevbcode.com/ShowCode.Asp?ID=1610
0
 
LVL 43

Expert Comment

by:TimCottee
ID: 7041795
I knew Ark must have done something like this, I should have checked myself really.
0
 

Author Comment

by:Luke_Stephens
ID: 7041830
On a VB course at the moment, no WinZip, so I can't check that dll out yet.  I'm not ignoring you all though, cheers for your help so far...
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 7041847
The link I pointed you to is done in pure VB
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 7041854
If Ark shows up in this thread, he deserves the credit...that man does wonders in "low-level" VB
0
 

Author Comment

by:Luke_Stephens
ID: 7041877
It's in a zip file now mate.
0
 
LVL 28

Expert Comment

by:AzraSound
ID: 7041949
Aware of that...just offering additional commentary at no charge   ;-)
0
 

Author Comment

by:Luke_Stephens
ID: 7041984
Very kind of you!
0
 

Author Comment

by:Luke_Stephens
ID: 7072103
Cheers mate, sorry for the long silence - I was on a course and this lad wanted to know how to do this.  Don't know if he managed it but I want to close this question!

Luke
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month15 days, 7 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question