Solved

Trapping keyboard input?

Posted on 1998-10-01
8
318 Views
Last Modified: 2010-04-30
I'd like to know if it;s possible to have a program run in the background that traps keyboard strokes.  So I can run the program and while I work in say a chat window or something the keystrokes will be recorded in a text file.
0
Comment
Question by:treyjeff
8 Comments
 
LVL 1

Expert Comment

by:abhinavm
ID: 1437758
You can do it by using APIs. i don't have full details right now but its not very diificult. you have to get the handle of window whose event you want to captur, then you can get all the messages going to that window. then you can do whatever processing you want and send it back to window.
   For this you have to take help on APIs
0
 
LVL 4

Expert Comment

by:mcix
ID: 1437759
What you are wanting to do is called a Hook.  It is difficult to implement in VB without a custom control or DLL.

Here are examples of such a control:

http://www.desaware.com/Desaware_Info/products/spy_works/spyinfo.htm
and
http://www.visual-design.se/VDGT/VDAMon.htm


0
 
LVL 12

Expert Comment

by:mark2150
ID: 1437760
Conversely you could load a DOS TSR prior to firing windows...
0
 
LVL 2

Expert Comment

by:polygon
ID: 1437761
You surely can, but it's not so easy. You need to create a sustem keyboard hook. This hook is a procedure which will be executed every time a key is stroked under Windows. The worst part is that this procedure (called hook procedure) must be in a DLL. If you want to record a keystrokes of a given window or textbox, there is surely an easier way.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 1

Author Comment

by:treyjeff
ID: 1437762
So does anyone know of an easy way?
0
 
LVL 3

Expert Comment

by:TheAnswerMan
ID: 1437763
Since you are wanting to spy on somone.  I reccommend going to a private detective shop and get yourself one of those miniature cameras and hide it over their shoulder.  Nice and Easy.  And you dont have to worry about and DLLs running.
0
 
LVL 1

Author Comment

by:treyjeff
ID: 1437764
There's always an ass in the crowd isn't there?  It is being used in a valid program.  If you have something that will help then let me know, or just keep your comments to yourself.
0
 
LVL 13

Accepted Solution

by:
Mirkwood earned 100 total points
ID: 1437765
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

705 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now