Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2005 Nov : How to capture all mouse events.

www.cryer.info
Managed Newsgroup Archive

How to capture all mouse events.

Subject:How to capture all mouse events.
Posted by:"Rachel Richardson" (rachel@nospam.plz)
Date:19 Nov 2005 13:40:26 -0700

hello all,

i'm creating a color picker style application that lets
the user get the color from anywhere on the screen by
clicking somewhere.

i tried two methods but none of them returned an acceptable
result!

1. i've used SetCapture/ReleaseCapture by handling
WM_LButtonDown and some other related stuffs.

it works good but there is a big problem there: when
i click somewhere on the screen, the color will be
picked but the mouse works normally. for example: when
i click on a button to get its color, the button will
be pressed too!

2. i used a VCL - gpSysHook - to use system hooks, but
it had some problems with the hook dll. it doesn't seem
to be my fault, since i've used the same code as is used
in the demo project. it also acts actually similar to my
first method. i mean when i click somewhere it interacts
with objects...

i prefere the first method since i have full control over
its code, but if there is anyway to get rid of that annoying
behaviour or if there is another way to simulate a color
picking tool just let me know too.

thanks for your helps,
Rachel Richardson

Glossary

Replies:

www.cryer.info
Managed Newsgroup Archive