Solved

System hook out of my aplication

Posted on 1998-03-16
4
254 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
[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
  • 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

707 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