Solved

System hook out of my aplication

Posted on 1998-03-16
4
249 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

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 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…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

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