Solved

System hook out of my aplication

Posted on 1998-03-16
4
244 Views
Last Modified: 2010-04-06
How can i make a system hook to see what´s hapenig out of
my aplication???

I need some codes...
0
Comment
Question by:kort77
  • 2
4 Comments
 
LVL 5

Expert Comment

by:JimBob091197
ID: 1360517
Hi

What kind of hooks are you looking for?  Key hooks?  Mouse hooks?  WndProc hooks?
If you provide your e-mail address, I will mail you a sample using key hooks.

Regards,
JB
0
 
LVL 1

Expert Comment

by:pjdb
ID: 1360518
From your question, i suppose that you know how to make hook for your application.
So as the last parameters of the call to SetWindowsHookEx, don't put the thread handle but put 0 instead. The same hook as the one you did use for your application will become enable to all the system

JDB
0
 

Author Comment

by:kort77
ID: 1360519
I need hook for the peripherics of the PC (Mouse, Keys, etc.), Open and close aplications and other basic operations.
I need some codes to guide my developing...

Thanks for your time!!!

- scortega@javercol.javeriana.edu.co -
0
 
LVL 1

Accepted Solution

by:
pjdb earned 20 total points
ID: 1360520
to install the hook for the keyboard :
myhook:=setwindowshookex(wh_keyboard, @clavier_hook_msg, system.hInstance, 0);

where clavier_hook_msg is a callback procedure defined as follow :
function clavier_hook_msg(code: Integer; wparam: Word; lparam: Longint): longint;      stdcall;
begin
  if (code<0) then
    result:=callnexthookex(clavier_crochet, Code, wparam, lparam)
  else
  begin
    your_job;
    result:=0; {continue the message to other hook/windows <>0 stop the message}
  end;
end;

wparam will containt the virtual key code of the pressed key and iparam some information about keyboard status

and finally to iuninstall the hook :
unhookwindowshookex(myhook);

JDB

PS : if you want more information contact me at mailto:jeanditbailleulp@usa.net
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

746 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

15 Experts available now in Live!

Get 1:1 Help Now