Solved

Hooking the keyboard

Posted on 2002-03-21
3
221 Views
Last Modified: 2010-04-05
Hi I want to make s small application that hooks the keyboard and logs all key pressings.

Some suggested GetAsyncKeyState but how can I trap ALL key pressings, what messages to I need to process? or how does it work?

Second I want to silently detect if a user is connected to the Internet how do I do that?

Some code examples would be much appreciated!

Thanks!
0
Comment
Question by:kbb2
3 Comments
 
LVL 22

Accepted Solution

by:
Mohammed Nasman earned 200 total points
ID: 6886520
look at these articles

An introduction to hook procedures
http://delphi.about.com/library/bluc/text/uc063001a.htm
http://delphifaq.com/fq/q2108.shtml

and for the second question

uses
  WinInet;

function IsConnected: Boolean;
begin
  Result := (InternetGetConnectedState(nil, 0))
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  if IsConnected then
    ShowMessage('you are online ')
  else
    ShowMessage('you are offline')
end;

0
 
LVL 9

Expert Comment

by:ginsonic
ID: 6887870
Go to www.delphi300.com and search for 'hook' .
Very good articles about . I use it and work perfect in all versions of Windows.

Nick

P.S. You must register to read the article but is freeware ( with the freeware registration you can read 50 old articles and daily just the new added ) .
0
 

Author Comment

by:kbb2
ID: 6888035
Thanks! Just what I needed!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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

Suggested Solutions

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

856 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