Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

System hook out of my aplication

Posted on 1998-03-16
4
Medium Priority
?
257 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 80 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

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

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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 this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

604 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