Solved

Hooking the keyboard

Posted on 2002-03-21
3
222 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: 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!

Question has a verified solution.

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

Suggested Solutions

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

726 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