How do i get a program to simulate a keypress to the system

Posted on 2005-04-17
Medium Priority
Last Modified: 2010-05-18
Hello all,

As some of you may or may not know, on Thinkpad computers you have the option to type in a 7 character password and "lock the hard drive". naturally some people loose their passwords and thus loose their hard drive.

I would like to write a program that would simulate a keypress from the keyboard. for example if the program called "Ctrl, Alt, Del" i would see the windows task manager because the program outputed the keypresses and the system responded. currently i do NOT know how to wright a C++ program to do this(if there is another language that can easly do it, then i might be willing to change the language)

Now i know that there are literaly billions of possible combonations with a 36^7 but i have some ideas that will limit that number down substansually, Also, it is my understanding that you have infinite retrys and very fast responce times from the hard drive.

my main idea for this program is to have the hard drive installed in a PC and will do constant interaction. another idea(some hardware required) would be to use the USB cord with a PS2 conection to the end, so that the computer would repeatedly send commands to the laptop computer "from the keyboard".

Yes, i know this will take a LONG time for the program to compleate it's task, but it is my hope that the Thinkpad users will be able to regain the use of their laptops.

Incase you are wondering(or perhaps you wish to make the program yourself) my idea to limit the possible number of combonations by asking the following questions.

1) are there only letters or only numbers?
2) Do you know of any specific letters or numbers in a specific place?
3)do you remember part of the password?
4) where are these parts located?
5)are the missing parts letters or numbers or both?

once again, i am only asking how to simulate a keyboard keypress from a computer program.
Question by:Diane258
LVL 11

Accepted Solution

sujit_kumar earned 120 total points
ID: 13803969
In VB you have a KeyPress Event trigger, using which you can simulate it. In Oracle Forms we have DO-KEY trigger which can be used for this. Do some RnD on them i am sure you can get your work done.

Some URLs that might help you,



Author Comment

ID: 13804049
Hey very good thank you :) i still have yet to get it to work, but that is my problem, but at least i know a potential problem with sendkeys. Altho the blog was not very specific as to what the replacement of the sendkeys is.

still it is something for me to work on :)
LVL 23

Expert Comment

ID: 13804359
Visual basic 6.0 :


That site shows you more or less about send keys :)

If you need any further help or you still want to create it in c++ let me know :)

www.cplusplus.com is a good starting place and also if you search for a guy called bruce eckel using google and you should find his site with all of the pdf's with regards to java and c++
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 86

Assisted Solution

by:Mike Tomlinson
Mike Tomlinson earned 80 total points
ID: 13806159
Silly question...if the hard drive is "locked", how do you propose putting your program on the system so it can send keys and crack the password?
LVL 22

Expert Comment

ID: 13808315
To the best of my knowledge, the only way around a ThinkPad HDD password is to re-write the eprom the password is stored in.  The only folks I know of who do this are:


Author Comment

ID: 13821301

Thanks for all the help guys.

i have had a few problems with it at first, and i still wanna know the c++ way to do it, but it seems to be working well :)

Now all i gotta do is post a question as to how i can compile a program to run in a non-windows enviroment :)

As to how i do this, well most laptops have a way to connect a PS2 keyboard, or perhaps a USB keyboard to the computer(at least out test TP does). A guy i know already created a "simulated" keyboard program, with the approiate cable provided.

  giving it about 300 combonations before finding the key and timeing it should give an accurate estimation as to how long it will take to "crack" the passowrd.

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
When you discover the power of the R programming language, you are going to wonder how you ever lived without it! Learn why the language merits a place in your programming arsenal.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Introduction to Processes

839 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