Link to home
Start Free TrialLog in
Avatar of Krakken
KrakkenFlag for Australia

asked on

Detect mouse clicks...

How can I make my Delphi application detect any mouse clicks the user makes anywhere on the screen?

~Krakken Out~
Avatar of BorlandMan
BorlandMan

That would require creating a system wide hook.

Use the functions SetWindowsHook(); UnhookWindowsHook()

and set the hook for WH_MOUSE  - but read the docs on these functions first - if used incorrectly, weird stuff could happen.

hth,
J
ASKER CERTIFIED SOLUTION
Avatar of Amir Azhdari
Amir Azhdari
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Krakken

ASKER

Hehe thanks. I will try that in a few hours. I already have a Jhook for keyboard input so I should be able to add the mouse detection to it aswell. :)

~Krakken Out~
Hey shouldn't the systemwide hooks be executed in dll?
Krakken:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.