Solved

Hooking the keyboard

Posted on 2002-03-21
3
214 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:
mnasman 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

747 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

10 Experts available now in Live!

Get 1:1 Help Now