Solved

How to create events systemwide?

Posted on 2008-10-24
8
183 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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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.

 

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Path  to current project in Delphi. 2 92
Virtuailstring tree compare node issue 14 125
Delphi: Connect to running MS Outlook 4 121
FMX and jaudiotracker playing memory stream 29 87
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…

861 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