Solved

Hooking the keyboard

Posted on 2002-03-21
3
218 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Thread safe  opinion 7 126
Convert Jpg /PNG To GIF 5 118
Simple Delphi Question 9 83
How to renew a Delphi rad-studio licence? 5 49
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

912 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

19 Experts available now in Live!

Get 1:1 Help Now