Solved

How to create events systemwide?

Posted on 2008-10-24
8
181 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
  • 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
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
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…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

813 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

10 Experts available now in Live!

Get 1:1 Help Now