Solved

How to create events systemwide?

Posted on 2008-10-24
8
187 Views
Last Modified: 2012-05-05
Hello Experts,

I'd like to know how to create events systemwide using Delphi7...For example, my application should detect all mouse clicks, or all keys pressed, or all files that are openned?? I don't want to use hooks....
0
Comment
Question by:Ventura_v
[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
  • 4
  • 4
8 Comments
 
LVL 28

Expert Comment

by:2266180
ID: 22798574
that's simple: AFAIK, you cannot do it without hooks.
0
 

Author Comment

by:Ventura_v
ID: 22798614
Hmm, I said it because, at least in my pc with Vista and nod32, when I work with hooks, it considers a malware and prevent it's execution...
0
 
LVL 28

Expert Comment

by:2266180
ID: 22799046
that depends what kind of hooking stuff you use. there are many on the net and some of them are incorrectly detected by antiviruses as malware.

you can use setwindowshookex winapi function for mouse and keyboard:
http://delphi.about.com/od/windowsshellapi/a/keyboard_hook.htm
http://delphi.about.com/od/windowsshellapi/a/mousehook.htm

file file creation you need to use code injection so you'll need a good library for that. I would suggest using madCodeHook but for some time madhis does not give it unless you're a good harted developer :)
so your alternatives are to test some free solutions like using the GINA stub or replacements:
http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_20733197.html
0
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!

 

Author Comment

by:Ventura_v
ID: 22803595
Yeah, I have a good component for code injection... But is there a way to make it run normally in Windows Vista?? It always blocks code injection and api hooks =\
The only hooks it doesn't block is the ones in setwindowshookex wm_...
0
 
LVL 28

Expert Comment

by:2266180
ID: 22803648
I don't have muich experience with vista. have you considered elevation?
you can also use the request attention link and ask the moderators to include this quesiton in a couple of other zones, something related to vista development.

here is a fast test for you to see if it will help: run your test program from the administrator account (not a user with admin, but the administrator account) and make sure you disable UAC. if it works, then it's all about configuring your applicaiton correctly. elevation plus enabling sufficient access rights (like debug priv, etc)
0
 

Author Comment

by:Ventura_v
ID: 22833433
Yeah, i've done that.... With UAC disabled and debug privileges it runs ok... But for other users it would be an obstacle making them disable UAC, restart windows and then run my app...
 
Since I can't disabel UAC with delphi code, they'll have to disable it manually... I guess it has to have some kind of manifest or something like that...
0
 
LVL 28

Accepted Solution

by:
2266180 earned 500 total points
ID: 22835210
>> Yeah, i've done that [...] guess it has to have some kind of manifest or something like that..

either you done that, or you didn't. you do it via a manifest file. so, since you say you don't have one, I am assuming you didn't do that. (elevation).

that's first step when making vista applications :)
here are some PAQ's to help you choose the manifest that best suits your needs (there are also other vista & delphi related information that you might find usefull:
http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_22755023.html
http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_22465261.html
http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_23083197.html
http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_22423950.html
http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_22566079.html
http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_22591892.html

after you read through all these PAQs, you should be able to understand a little how vista security works in reagrds to this UAC thing and what the manifest can do for you ;)
0
 

Author Comment

by:Ventura_v
ID: 22850805
That was exactly what I was looking for!!
 
Thanks ciuly =)
0

Featured Post

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

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…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

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